Idk Why But this script is not working please correct it:
local browser
local browserVisible = false
local screenWidth, screenHeight = guiGetScreenSize()
function createYouTubeBrowser()
-- Create the browser with a custom size and position
local browserWidth, browserHeight = 800, 600
local browserPosX, browserPosY = (screenWidth - browserWidth) / 2, (screenHeight - browserHeight) / 2
browser = createBrowser(browserWidth, browserHeight, true, false)
setBrowserProperty(browser, "scalable", "false")
setBrowserProperty(browser, "movable", "true")
-- Load the YouTube website
loadBrowserURL(browser, "https://www.youtube.com")
end
function toggleYouTubeBrowser()
if browserVisible then
-- If the browser is already showing, hide it
destroyElement(browser)
browserVisible = false
else
-- If the browser is not showing, create it
createYouTubeBrowser()
browserVisible = true
end
end
-- Bind the toggleYouTubeBrowser function to the F4 key
bindKey("F4", "down", toggleYouTubeBrowser)
This is AI generated script from Chat GPT btw The script is not working and showing no error in the console or in the debug please help