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

trying to make a place teleport gui but doesnt work, help?

script.Parent.Parent.ImageButton.MouseButton1Click:connect(function(click)
	if click.Parent:FindFirstChild("Humanoid") ~= nil then
		game:GetService("TeleportService"):Teleport(script.Parent.ID.Value, game.Players[click.Parent.Name])
		wait (10)
	end
end)

When I use this it tells me "Attempt to index local 'click' (a nil value)" Any help?

1 answer

✓ Accepted answer
plr = game.Players.LocalPlayer

script.Parent.Parent.ImageButton.MouseButton1Click:connect(function()
    if plr.Character:FindFirstChild("Humanoid") then
        game:GetService("TeleportService"):Teleport(script.Parent.ID.Value, plr)
        wait (10)
    end
end)

this should work in a localscript, if it's a serverscript it won't work

1 comment

0

thank you man

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