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

how to fix my line 5 on my GUI place teleporter script?

Asked by 2 years ago
Edited 2 years ago
local TeleportService = game:GetService("TeleportService")
local place = 10707384690

script.Parent.MouseButton1Down:Connect(function(plr)
    TeleportService:Teleport(place, plr)
end)

and also in the dev console it said unable to cast value to object

1 answer

Log in to vote
0
Answered by 2 years ago

What you are needing to do is this

s = game:service("TeleportService")
id = 6736051032--Put ur id of game

function onClick()
s:Teleport(id)
end
script.Parent.MouseButton1Click:connect(onClick)

Put script in a button in gui Go to your game settings and make sure Allow third party teleport is on

Ad

Answer this question