Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Click door problems on client?

Asked by 8 years ago

I made a click door script. It works correctly on Studio** Test **mode but on the ROBLOX client it is not working.

Door = script.Parent.Parent.Door

function onClicked()
         Door.Transparency = 0
         Door.CanCollide = true
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 answer

Log in to vote
0
Answered by 8 years ago

You probably are trying to reference the door/clickdetector before it exists. Try using this instead as it waits for both the door and the click detector before it references them.

Door = script.Parent.Parent:WaitForChild("Door")

function onClicked()
         Door.Transparency = 0
         Door.CanCollide = true
end
script.Parent:WaitForChild("ClickDetector").MouseClick:connect(onClicked)

If this doesnt fix it, press F9 in game, and look at the server log, and tell me if there is any output.

0
It doesn't change anything. Here's server log: http://postimg.org/image/plw6s3zy7 prt0t32 5 — 8y
Ad

Answer this question