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

How do i check all players that are seated in a model?

Asked by 5 years ago

So, this is my idea, if a parts is going to get touched by a model, i want all players who are seating in the model to teleport. My question is: how do i check all players that are seated in a model?

local part = script.Parent

part.Touched:Connect(function(hit)

if hit.Parent.ArmyTruck then
    print("Army Truck")
    local players = game.Players

end
end)

This is the code.

1 answer

Log in to vote
0
Answered by
MiguRB 60
5 years ago

Every player's character has humanoid and there is a bool value (true or false value) called sit in the player's humanoid. So when the player sits, the value changes to true and so on...

You can check every player's sit value and teleport them

0
ah thank you BaconX112X 75 — 5y
0
No problem ;) MiguRB 60 — 5y
Ad

Answer this question