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

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

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

Ad

Answer this question