|
| 11 Sep 2015 05:33 PM |
| I need a script that would make a player jump from a seat if they do not own a gamepass, the script below won't work. It simply lets anyone use the car even though it is correct (I think). If anyone finds the reason it is not working, it would be a real help. |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Sep 2015 05:35 PM |
local passId = 0000000 function isAuthenticated(player) 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) |
|
|
| Report Abuse |
|
|
|
| 11 Sep 2015 05:35 PM |
My bad, thought I pasted it and rushed to post it lol
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 11 Sep 2015 05:44 PM |
| Do you mean that I need to rename the seat part1? |
|
|
| Report Abuse |
|
|
|
| 11 Sep 2015 05:45 PM |
| what happens when you print obj.Name? |
|
|
| Report Abuse |
|
|
|
| 11 Sep 2015 05:47 PM |
| Not sure, I only edited parts of the wiki script. |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Sep 2015 06:13 PM |
local passId = 252580855
function isAuthenticated(player) print("Got info") return game:GetService("GamePassService"):PlayerHasPass(player, passId) end
script.Parent.VehicleSeat.ChildAdded:connect(function(obj) if game.Players:FindFirstChild(obj.Part1.Parent.Name) then plr = game.Players:FindFirstChild(obj.Part1.Parent.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) |
|
|
| Report Abuse |
|
|
177117
|
  |
| Joined: 17 May 2010 |
| Total Posts: 1366 |
|
| |
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 11 Sep 2015 06:24 PM |
Don't use PlayerHasPass Use MarketplaceServier:PlayerHasAsset
"You're all idiots" |
|
|
| Report Abuse |
|
|