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

Script that makes a player jump out of vehicle seat if they don't have a certain game pass? [closed]

Asked by 10 years ago

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.

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?

1 answer

Log in to vote
0
Answered by
hiccup111 231 Moderation Voter
10 years ago

Try this

01local passId = 0000000 -- change this to your game pass ID.
02 
03function isAuthenticated(player) -- checks to see if the player owns your pass
04    return game:GetService("GamePassService"):PlayerHasPass(player, passId)
05end
06 
07script.Parent.VehicleSeat.ChildAdded:connect(function(obj)
08    if game.Players:FindFirstChild(obj.Part1.Name) then
09        plr = game.Players:FindFirstChild(obj.Part1.Name)
10    end
11 
12    if plr and not isAuthenticated(plr) then
13        plr.Character.Humanoid.Jump = true
14        print(plr.Name.." is not authorized to use this vehicle")
15    end
16end)
0
To note, half of this is from the WIKI, I just made modification ( http://wiki.roblox.com/index.php?title=Game_Pass ) hiccup111 231 — 10y
0
I tried but I didn't really understand it haha, i'll tell you if it works during beta. Intoxicatedbrownie 0 — 10y
Ad