Ive got the script in a localscript inside startergui. When i click it, it says "attempt to call a nil value" in the output. How would i get this to work?**
function onClick() if game.Players.LocalPlayer.Character.Head.Transparency == 1 then print("yes") else print("no") end end script.Parent.MouseButton1Click:connect()
You forgot to pass the function "onClick" as a parameter to "connect"
Corrected:
function onClick() if game.Players.LocalPlayer.Character.Head.Transparency == 1 then print("yes") else print("no") end end script.Parent.MouseButton1Click:connect(onClick)
function onClick() if game.Players.LocalPlayer.Character.Head.Transparency == 1 then print("yes") else print("no") end
end script.Parent.MouseButton1Click:connect(onClick)