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

How do I fix this script?

Asked by
tanzane 100
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
F = GetMouse()

function Clicked()
    workspace.Door.CanCollide = false
    workspace.Door.Transparency = 0.5
    wait(3)
    workspace.Door.Transparency = 0
    workspace.Door.CanCollide = true    


end
workspace.Button.F.Button1Down:connect(Clicked)

I can't seem to figure out how to get the Click event to work. What do I need to do to fix this? Or what needs to be added and taken out?

1 answer

Log in to vote
3
Answered by 10 years ago

Because for a brick to be able to be clicked you must add a ClickDetector. Which allows clicks on a brick.

To learn more about how to use ClickDetectors look here: http://wiki.roblox.com/index.php?title=ClickDetector

game.Workspace.Button.F.ClickDetector.MouseClick:connect(Clicked)
Ad

Answer this question