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

how to specify in a script that we want to talk about a specific object?

Asked by 2 years ago
Edited 2 years ago

how to specify in a script that we want to talk about a specific object? see line 6 I don't know how to specify the vehicle?? I am trying to make a car gamepass that kicks you out and spawn the pass so you can buy it?

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService('Players')
local id = 27137596

Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
    if MarketPlaceService:UserOwnsGamePassAsync(id) then
         --whatever vehicle code/module
    else
    if Occupant:FindFirstChild('Humanoid') then -- verifies if the occupant has a humanoid(if is a player)
         local plr = Players:GetPlayerFromCharacter(Occupant) -- gets the player from the occupant of the seat(character)
        MarketplaceService:PromptGamePassPurchase(plr, id) -- prompts the gamepass claim to purchase it.
        Seat.Occupant = nil
     end
   end
end)

0
Could you explain a bit more in-depth what you're trying to do? AronYstad 101 — 2y
0
Because line 6 specifies a game pass, not an instance. AronYstad 101 — 2y
0
are you asking how if check if a player owns a gamepass or what? yazooonawad 0 — 2y
0
@AronYstad im trying to make a car gamepass that kicks you out and spawn the pass to buy if you don't own the pass rollonthebeat 1 — 2y

Answer this question