New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Why doesn't this text button teleporter work when I click it?

Asked by 3 months ago

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

Log in to vote
0
Answered by
noammao 294 Moderation Voter
3 months ago
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).

0
Thanks! iHavoc101 23 — 3mo
Ad

Answer this question