Motofied
|
  |
| Joined: 26 May 2014 |
| Total Posts: 3050 |
|
|
| 27 Feb 2017 07:49 AM |
Can someone possibly start me a script where if the player has the gamepass they get +5000 cash when they enter a server. I've tried making this and failed.
#code print('My name is Moto and who cares?') |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 27 Feb 2017 08:07 AM |
local ms = game:GetService("MarketPlaceService"); local pass = 00194823527835903485293853498524542344523592830305837475;
game.Players.PlayerAdded:connect(function(plr) if ms:PlayerOwnsAsset(plr,pass) then --award end end
|
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 27 Feb 2017 08:08 AM |
Lol but my dude people could leave and join and join and leave and leave and join and become billionaires
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
|
| 27 Feb 2017 09:11 AM |
PassId = 666869112 game:GetService("Players").PlayerAdded:connect(function(Player) if game:GetService("GamePassService"):PlayerHasPass(Player, PassId) then wait(1) Player:WaitForChild("leaderstats"):WaitForChild("Points").Value = 5000
print("worked") end end)
tested, works. i use for my game. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 27 Feb 2017 03:17 PM |
^PlayerHasPass returns cached results from the start of the server. Not saying you're wrong but if ya don't want players to have to rejoin upon purchasing their passes, use PlayerOwnsAsset.
|
|
|
| Report Abuse |
|
|