I would like to know how to make a police car that allows only that team (in this case, police) to drive it. Thanks.
✓ ANSWER ACCEPTED
How do I make a "Team only vehicle seat script"?
1 answer
✓ Accepted answer
Put this in the vehicle seat
script.Parent.Touched:connect(function(hit) -- Fires when seat is touched
local player = game.Players:GetPlayerFromCharacter(hit.Parent) -- locates the player
local cops = game.Teams:WaitForChild("Cops") -- change "Cops" to the team name
if hit.Parent:FindFirstChild("Humanoid") and player.Team ~= cops then -- checks if player isn't in team
wait(0.05)
hit.Parent.Humanoid.Sit= false -- kicks player off of seat
end
end)
This should work because I tested it! Accept my answer if it does!
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thank you so much!