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

How to teleport a player, and kill players?

Ok, I would of done this myself, but.. I don't know how to get into the player, so I can teleport him and kill him, heres the script.....

RoundStart = game.Workspace.RoundStart 
RoundInProgress = game.Workspace.RoundInProgress 
RoundEnd = game.Workspace.RoundEnd
PlayerSpawn = game.Workspace.PlayerSpawn

while wait() do
	wait(1)
	if RoundStart.Value == true and RoundInProgress.Value == false then
		
		
		--Ment to teleport the player to "PlayerSpawn.Position"
		
		
	elseif RoundEnd.Value == true and RoundInProgress.Value == true then
		 
	
		
		--Ment to kill the player.
		
		
	end
end

3 comments

0

isn't this kind of requesting?

0

Not precisely. I believe he is wanting a finished result of the script with an exolanation to why our way works. Although this should have been put in a better way.

0

I just need help, how I get into a player's model, I know how to set Humaniod health, and kind of how to teleport ... :/

1 answer

✓ Accepted answer

Teleportation article on ROBLOX wiki

As for killing a player:

-- assuming player is a variable that points to a player
if player.Character and player.Character:FindFirstChild("Humanoid") then
	player.Character.Humanoid.Health = 0
end

If you were scripting a weapon to deal only a certain amount of damage, you could use TakeDamage(), but that function doesn't damage through a forcefield because it's intended to stop spawnkilling. In your case, you probably want to kill the player no matter what.

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