Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a "Team only vehicle seat script"?

I've tried looking at other posts but it doesn't seem to work. Can anyone help me, please?

1 answer

You need to check as soon as the occupant changed whether or not the given player is of a certain team. If he is not you can force jump him to get him out of the seat.

Example:

local seat = script.Parent -- Change this as needed

seat:GetPropertyChangedSignal("Occupant"):Connect(function()
	local occupant = seat.Occupant
	
	if occupant then
		local player = game.Players:GetPlayerFromCharacter(occupant.Parent)
		if player.Team ~= game.Teams.YourTeam then -- Change YourTeam
			occupant.Jump = true
		end
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.