This is my gamepass only vehicle script that kills the player and prompts purchase when the player doesn't have the gamepass. I assume the kill and prompt purchase part doesn't seem to be working. The script is inside the driver's seat of the vehicle.
id = 6528838
promptpurchase = true
game.Players.RespawnTime = 0
gps = game:GetService("GamePassService")
local player = game.Players.LocalPlayer
script.Parent.Changed:connect(function(prop)
if prop == "Occupant" and script.Parent.Occupant then
if gps:UserOwnsGamePassAsync(game.Players:GetPlayerFromCharacter(script.Parent.Occupant.Parent), id) then
print("User in car has gamepass.")
else
script.Parent.Occupant:TakeDamage(100)
if promptpurchase == true then
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, id)
end
end
end
end
Please help if you can, it's annoying that this doesn't seem to work.

1 comment
I've tried that script before I believe, and I edited it to make it work with the new gamepasses, and it doesn't work. That's for the help though. (still looking for a solution)