Still have questions? Join our Discord server and get real time help.
0

# How to make a vehicle only driveable by people with a certain gamepass?

Question 1: How do i make a certain team open something Question 2: How to make a vehicle only driveable by people with a certain gamepass?

I am making a border game and i want a certain team to open the border not like anyone could open the border. So i need help on that.

Second question is how do i make a car only driveable by the people who owns the gamepass. Also need help on this.

0
Pupppy44 458
7 days ago
Edited 7 days ago

You can use UserOwnsGamePassAsync. I didn't try this:

function Change() -- The function
if workspace.Seat.Occupant ~= nil then -- Checks if the Occupant is not nil aka. nothing
local Player = game:GetService("Players"):FindFirstChild(workspace.Seat.Occupant.Parent.Name)
if Player then -- If "workspace.Seat.Occupant.Parent.Name" is found in game.Players
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, 1234) then -- Checks if the player has the gamepass 1234
print("Has gamepass") -- Prints
else
workspace.Seat.Occupant.Jump = true -- Jumps the player so the player cannot sit on it.
end
end
end
end

workspace.Seat.Changed:Connect(Change) -- Using the Changed event to detect a new occupant