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

How can I make a Surface GUI button for a door?

Asked by 10 years ago

I want to have a script where I can control my door or gate based on a surface GUI button. The main problem is that I am still learning coding as a beginner and I don't know certain functions that roblox uses. I want the door or gate to open both sides but with extra stuff on it to make it look modern futuristic. The door or gate I am working on just needs scripting and a nice working surface GUI button to make the model.

[Link] http://www.roblox.com/Access-Fallen-place?id=100762280

P.s Development server where I build all my models free to observe and look at the door or gate.

1 answer

Log in to vote
2
Answered by
TomsGames 225 Moderation Voter
10 years ago

First: You are still learning code, grreat. But you said "I don't know certain functions that roblox uses", just so you know they're called methods :)

Second: It's quite simple, when the button is clicked, it runs code to open door. Here is a really short snippit of code which makes it ready to open the door:

script.Parent.MouseButton1Down:connect(function()
print("Opening door")
--Open door stuff
end)

That will print ("Opening door") into the output. This will only work once, opening the door. I'm sure you can develop it to make it open AND close.

Good luck, hope this is enough to start you off!

Ad

Answer this question