Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

why doesn't this teleport button not work?

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

✓ Accepted answer
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)

3 comments

0

its still not working :*(

0

Output? You need to edit this to the right settings or whatever :3

0

thank you for the help it works now after tweaking a few things

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

2 comments

0

it still doesn't work no errors

0

then also remove local Tele = ...

This discussion is preserved as it was. New answers, comments, and votes are closed.