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

why doesn't this teleport button not work?

Asked by
nicros 165
9 years ago

could somone point out what is causing this button to not telelport?

01local reqLevel = 1
02local player = game.Players:WaitForChild("LocalPlayer")
03local pos = CFrame.new()
04local Tele = game.StarterGui.Telebook:WaitForChild("tele2")
05 
06script.Parent.MouseButton1Down:connect(function()
07    if player.leaderstats.Lvl.Value >= reqLevel then
08        player.Character:MoveTo(Vector3.new(408.486, 378.5, -415.248))
09    end
10end)

2 answers

Log in to vote
1
Answered by
Ryzox 220 Moderation Voter
9 years ago
01local reqLevel = 1
02local player = game.Players.LocalPlayer
03--local pos = CFrame.new() -- what's this?
04--local Tele = game.StarterGui.Telebook:WaitForChild("tele2") -- not sure why you're waiting for something in startergui. Is this meant to be playergui?
05local Tele = player.PlayerGui.Telebook:WaitForChild("tele2")
06 
07script.Parent.MouseButton1Down:connect(function()
08    if player.leaderstats.Lvl.Value >= reqLevel and player.Character then
09        player.Character:MoveTo(Vector3.new(408.486, 378.5, -415.248))
10    end
11end)
0
its still not working :*( nicros 165 — 9y
0
Output? You need to edit this to the right settings or whatever :3 Ryzox 220 — 9y
0
thank you for the help it works now after tweaking a few things nicros 165 — 9y
Ad
Log in to vote
1
Answered by
Hexcede 52
9 years ago

change game.Players:WaitForChild("LocalPlayer") to game.Players.LocalPlayer. LocalPlayer is a property.

0
it still doesn't work no errors nicros 165 — 9y
0
then also remove local Tele = ... Hexcede 52 — 9y

Answer this question