Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How to teleport a player, and kill players?

Asked by
lucas4114 607 Moderation Voter
9 years ago

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

01RoundStart = game.Workspace.RoundStart
02RoundInProgress = game.Workspace.RoundInProgress
03RoundEnd = game.Workspace.RoundEnd
04PlayerSpawn = game.Workspace.PlayerSpawn
05 
06while wait() do
07    wait(1)
08    if RoundStart.Value == true and RoundInProgress.Value == false then
09 
10 
11        --Ment to teleport the player to "PlayerSpawn.Position"
12 
13 
14    elseif RoundEnd.Value == true and RoundInProgress.Value == true then
15 
View all 22 lines...
0
isn't this kind of requesting? woodengop 1134 — 9y
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. alphawolvess 1784 — 9y
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 ... :/ lucas4114 607 — 9y

1 answer

Log in to vote
2
Answered by
Merely 2122 Moderation Voter Community Moderator
9 years ago

Teleportation article on ROBLOX wiki

As for killing a player:

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

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.

Ad

Answer this question