Player
A player who is connected to the server, which your scripts get from events like players.joined.
A player who is connected to the server, which your scripts get from events like players.joined.
Sets the player's health to 0, which kills them straight away.
player:kill()Use it forkill bricks, falling off the map, or losing a round.
Takes health away from the player, and can say which player caused it.
player:damage(25)Use it forlava, traps and weapons, or anything else that should hurt players.
amountHealth to take away.byoptionalThe player who did it. Damage by a teammate does nothing while friendly fire is off.Gives the player health back, but never more than their max health.
player:heal(10)Use it forhealth packs, healing zones, or potions that players drink.
amountHealth to give, up to max_health.Brings the player back at a spawn point right away.
player:respawn()Use it forrestart buttons, or sending everyone back home after a round.
Moves the player straight to a position, or onto an instance.
player:teleport(math3d.vector3.new(0, 10, 0))Use it forportals, obby checkpoints, or moving players into the arena.
targetA position within 100000 studs of the origin, or an instance to go to.Seats the player on a seat, and says whether it worked.
local seated = player:sit(part)Use it forputting players in a car, a ride or a chair from a script.
seatAn instance that is a seat.Gets the player up from the seat they are sitting in.
player:stand()Use it forkicking players out of a vehicle when the ride is over.
Brings the player back at a spawn point, a team's spawn, or a position you choose.
player:spawn("Red")Use it forsending players to their team's base when a match starts.
atoptionalA spawn point, a position, a team or a team name. Nil picks a spawn point as usual.Says whether the player is still in the server or has left.
if player:exists() then player:heal(10) endUse it forchecking the player did not leave while your script was waiting.
Pushes the player as if an explosion hit them.
player:apply_impulse(math3d.vector3.new(0, 300, 0))Use it forjump pads, explosions, or knockback when a player gets hit.
impulseThe push. A player's mass is 20.