So basically I wand to add a gamepass function to this script so when i someone buys it they can press the image button spawn the Vehicle:
script.Parent.MouseButton1Click:connect(function(GetCar) Mod = game.ServerStorage.HoverJeep clone = Mod:clone() clone.Parent = workspace clone:MakeJoints() end)
All I need now is the gamepass function but I don't Know How To Add It!
You are using a local script right? If so then:
local market = game:GetService("MarketplaceService") local player = game.Players.LocalPlayer local ID = 12345678 -- your id script.Parent.MouseButton1Click:connect(function(GetCar) if market:UserOwnsGamePassAsync(player.UserId, ID) then Mod = game.ServerStorage.HoverJeep clone = Mod:clone() clone.Parent = workspace clone:MakeJoints() end end)
it checks if player has the gamepass and if yes then it does the function.
Closed as Not Constructive by youtubemasterWOW
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?