Button script is not working

I have an image button inside of a frame and when you click it its supposed to make a toggle visible and the old one invisible and i also have it setting the transparency of a particle emitter in the workspace but its not doing any of that
This is the script inside the button:

script.Parent.MouseButton1Click:Connect(function()
	game.Workspace.Click:Play()
	game.Workspace.Season.Parts.Transparency = 1
	script.Parent.Visible = false
	script.Parent.Parent.SeasonOn.Visible = true
end)
local toggled = false
script.Parent.MouseButton1Click:Connect(function()
        toggled = not toggled
	game.Workspace.Click:Play()
	game.Workspace.Season.Parts.Transparency = toggled and 0 or 1
	script.Parent.Visible = toggled and false or true
	script.Parent.Parent.SeasonOn.Visible =  toggled and false or true
end)
1 Like

I tried this and it still didnt work at all just nothing happened

Is the script a LocalScript?

1 Like

yea its in a local script AAAAAAAAAAAAAAAAAAA