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

How to make a vehicle seat script for multiple teams?

Asked by 4 years ago
Edited 4 years ago

As previously shown on this forum site before, there were seat scripts restricted to singular teams, but I want help on making it to multiple teams. If you can help me, I'd appreciate it. I got a script to start off of provided from VeryRaven from a similar forum page.

(https://scriptinghelpers.org/questions/46281/how-do-i-make-a-team-only-vehicle-seat-script)

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)

Thank you.

0
Try doing local cops = game.Teams:WaitForChild("Cops") and ("Criminals") instead of ("Criminals") put your team name. N33H 19 — 4y
0
Thanks for the response but it didn't work. codykneeper -15 — 4y

Answer this question