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

Moving jail cell door on click?

Asked by 10 years ago

Hello, how would I make a jail cell move to the right/left when I click a button? Help please

1 answer

Log in to vote
0
Answered by
Bman8765 270 Moderation Voter
10 years ago

This does involve the ClickDetector to be added to the block. (Just go to advanced objects and search ClickDetector). After that you should make a script inside of the block they click. Now read this wiki: http://wiki.roblox.com/index.php?title=API:Class/ClickDetector/MouseClick Now here is some basic code I suggest:

function onClicked ()
    script.Parent.Visble = false -- Changes the block to invisible
end


script.Parent.ClickDetector.MouseClick:connect(onClicked) -- When the user clicks the block

Of course this probably won't be your exact variables but this is an example. In this script the user clicks the block and it turns invisible. Hope this helped! For moving blocks read about cframing here: http://wiki.roblox.com/index.php/CFrame

Ad

Answer this question