I'm making a jeep gamepass in my game and I can make the gamepass owner only area where they get the vehicle but when they drive it out of that area somebody could steal it. I need a fast answer.
✓ ANSWER ACCEPTED
How can I make a vehicle only drivable by people with a gamepass?
1 answer
✓ Accepted answer
Put this in a Script in the VehicleSeat
local GamePassService = game:GetService("GamePassService")
local passId = 0000000 -- change this to your game pass ID
local vehicleSeat = script.Parent
vehicleSeat:GetPropertyChangedSignal("Occupant"):Connect(function()
if vehicleSeat.Occupant then
local player =
game.Players:GetPlayerFromCharacter(vehicleSeat.Occupant.Parent)
if player and GamePassService:PlayerHasPass(player, passId) then
vehicleSeat.Disabled = false
else
vehicleSeat.Disabled = true
end
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
THANK YOUUUUUU