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?
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