Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Click door problems on client?

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

✓ Accepted answer

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.

1 comment

0

It doesn't change anything. Here's server log: http://postimg.org/image/plw6s3zy7

This discussion is preserved as it was. New answers, comments, and votes are closed.