ok so i was scripting right because i love roblox (friend me: lukester535 well have a gud teim :) ) and i found an error idk whats happening this works:" function Collide() script.Parent.Transparency = 0 end
script.Parent.ClickDetector.MouseClick:connect(Collide)”
but this:
function Collide() if script.Parent.Transparency = 0 end
script.Parent.ClickDetector.MouseClick:connect(Collide)
doesnt i mean obviosly because i didnt finish but its giving me an error at the “=“ and even if i finish it:
function Collide() if script.Parent.Transparency = 0 then script.Parent.Transparency = 1 end end
script.Parent.ClickDetector.MouseClick:connect(Collide)
i still get it
'=' means a declaration or setting a value, as in
local x = 5
So if it's placed in an 'if' statement it will give an error
'==' means if 2 values are equal, as in
if (x == 5) then
Change your 'if' line to the right equals sign
Hi, next time you type a script please put them in code blocks, way easier to read!
Explanation
If statements use '==' instead of '='
Final script
script.Parent.ClickDetector.MouseClick:connect(function() if script.Parent.Transparency == 0 then script.Parent.Transparency = 1 end end)
Hope this works, if you need any help or got questions ask em!
~ Arthenix