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

How to script a teleporting elevator Button?

Asked by 8 years ago

Can anyone help me? I am trying to make an elevator that is a teleporting one. So when a player clicks the click detector it will teleport them to the the position. Yet my script isn't working and i copied it from a video and its still wrong. So the following script is my script, So this code is to teleport the player who clicked the button to the first floor.:

Player = game.Players.LocalPlayer Floor1 = script.Parent Floor1B = game.Workspace clickDetector = game.Workspace.Button LeftDoor = game.Workspace RightDoor = game.Workspace

script.Parent.clickDetector.MouseClick:connect(function(Player) wait(0.1) local Player = Player.Character:MoveTo(Vector3.new(283, 30.671, -125.495)) end)

Please feel free to change things around in order to help me. I am not very good at scripting so please be considerate. Thank You!

0
the problem is that you are calling an anon function and then setting a variable of player. rather than doing that , remove local player and just put Player.Character:MoveTo(Vector3.new(**insert position here) scottmike0 40 — 8y
0
This would be sooo much more easy if you used a code block. I think your problem it that you used a local script. I would help you but this hurts my brain to try to read. User#11440 120 — 8y

Answer this question