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 text button teleporter work when I click it?

I am making a between game teleporter, but when I click it, it doesn't work, help please?

`local TeleportService = game:GetService("TeleportService") local gameID = 3449790483

function Click(mouse) local player = game.Players:GetPlayerFromCharacter(click.Parent) if player then TeleportService:Teleport(gameID, player) end end

script.Parent.MouseButton1Down:connect(Click)`

1 answer

✓ Accepted answer
local TeleportService = game:GetService("TeleportService") 
local gameID = 3449790483

function Click(mouse) 
local player = game.Players:GetPlayerFromCharacter(mouse.Parent) 
	if player then 
	TeleportService:Teleport(gameID, player)
	end 
end

script.Parent.MouseButton1Down:connect(Click)

You accedentally wrote GetPlayerFromCharacter(click.Parent) instead of GetPlayerFromCharacter(mouse.Parent).

1 comment

0

Thanks!

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