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
8 years ago

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

local reqLevel = 1
local player = game.Players:WaitForChild("LocalPlayer")
local pos = CFrame.new()
local Tele = game.StarterGui.Telebook:WaitForChild("tele2")

script.Parent.MouseButton1Down:connect(function()
    if player.leaderstats.Lvl.Value >= reqLevel then
        player.Character:MoveTo(Vector3.new(408.486, 378.5, -415.248))
    end
end)

2 answers

Log in to vote
1
Answered by
Ryzox 220 Moderation Voter
8 years ago
local reqLevel = 1
local player = game.Players.LocalPlayer
--local pos = CFrame.new() -- what's this?
--local Tele = game.StarterGui.Telebook:WaitForChild("tele2") -- not sure why you're waiting for something in startergui. Is this meant to be playergui?
local Tele = player.PlayerGui.Telebook:WaitForChild("tele2")

script.Parent.MouseButton1Down:connect(function()
    if player.leaderstats.Lvl.Value >= reqLevel and player.Character then
        player.Character:MoveTo(Vector3.new(408.486, 378.5, -415.248))
    end
end)
0
its still not working :*( nicros 165 — 8y
0
Output? You need to edit this to the right settings or whatever :3 Ryzox 220 — 8y
0
thank you for the help it works now after tweaking a few things nicros 165 — 8y
Ad
Log in to vote
1
Answered by
Hexcede 52
8 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 — 8y
0
then also remove local Tele = ... Hexcede 52 — 8y

Answer this question