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

My teleporting button dosent teleport players to me, why?

So, my TP all button on a control panel im making, dosen't work. I tried making a test on 2 players but nothing happened when i clicked the button, not even an error.

Here is the code:

local button = script.Parent
function clicked(player)
	for _, players in pairs(game.Players:GetPlayers()) do
	if players.Character then
		players.Character.Torso.CFrame = player.Character
	end
end
end


script.Parent.MouseButton1Down:connect(clicked)

1 answer

✓ Accepted answer

player.Character should be player.Character.Torso.CFrame

Also MouseButton1Down does not give the player who clicked as parameter, it only sends x & y coordinates of where the MouseButton1 gone down.

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