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

My teleport on TextButton script is not working. What is wrong with it?

Asked by 9 years ago

How can I fix this script? Nothing happens when I click on the TextButton.

local id = 218755429 
local button = script.Parent 

button.MouseButton1Click:connect(function() 
    game:GetService("TeleportService"):Teleport(id)
end)

0
This is a request, please show a script, and then we'll help improve or fix it BSIncorporated 640 — 9y
0
I added the script ^ DrCylonide 158 — 9y
0
thanks, the problem is that it has no clue who the player is. Give me a minute and ill figure it out BSIncorporated 640 — 9y
0
^ Thank you! Haha, I completely forgot about that. DrCylonide 158 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

Make sure this is a LOCAL SCRIPT

id = 218755429 
button = script.Parent 

button.MouseButton1Click:connect(function() 
    game:GetService("TeleportService"):Teleport(id)
end)

If this works please accept my answer.

If not, please, let me know and I'll try and fix it

THANKS!

0
The teleport starts, then it claims that there are insufficient priviledges. The game I am teleporting the player to is inactive. Is that the problem? DrCylonide 158 — 9y
0
Yes, but you can put the place you want to teleport to inside of the place your at, then it would work. BSIncorporated 640 — 9y
0
Haha, yeah, I had to add it to the game. Thanks! DrCylonide 158 — 9y
0
No problem :D BSIncorporated 640 — 9y
Ad

Answer this question