Im making a racing game and want to have cars that you're required to have a gampass to drive so how would I make it possible so that if the player doesn't have the gamepass, the script would make the player jump out of the car.
Try this
local passId = 0000000 -- change this to your game pass ID. function isAuthenticated(player) -- checks to see if the player owns your pass return game:GetService("GamePassService"):PlayerHasPass(player, passId) end script.Parent.VehicleSeat.ChildAdded:connect(function(obj) if game.Players:FindFirstChild(obj.Part1.Name) then plr = game.Players:FindFirstChild(obj.Part1.Name) end if plr and not isAuthenticated(plr) then plr.Character.Humanoid.Jump = true print(plr.Name.." is not authorized to use this vehicle") end end)
Closed as Not Constructive by evaera
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?