|
| 25 Aug 2014 11:29 PM |
Basicly I need help for a gamepass script, when a user enters a game they get a hat.
Players = game:GetService("Players") GamePassService = game:GetService("MarketplaceService") PassId = ID Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Character) if GamePassService:PlayerHasPass(Player.userId, PassId) then Spawn(function()
^^^ Im asumming its like that, but i dont know the last line.. helP?
69k/100k |
|
|
| Report Abuse |
|
|
Vuxz
|
  |
| Joined: 23 Dec 2011 |
| Total Posts: 7217 |
|
|
| 25 Aug 2014 11:33 PM |
gps = game:GetService("GamePassService");
id = 000000 --id here
game.Players.PlayerAdded:connect(function(Player) Player:WaitForDataReady() if gps:PlayerHasPass(Player , id.Value) then coroutine.resume(coroutine.create(function() while wait() do repeat wait() until Player.Character~=nil hat = game.Lighting.Hat:clone() -- change hat name and put hat in lighting hat.Parent = Player.Character end end)) end end)
|
|
|
| Report Abuse |
|
|
smunkey
|
  |
| Joined: 17 Dec 2011 |
| Total Posts: 342 |
|
|
| 25 Aug 2014 11:33 PM |
game.newPlayer.playerAdded()
or something like that |
|
|
| Report Abuse |
|
|
Vuxz
|
  |
| Joined: 23 Dec 2011 |
| Total Posts: 7217 |
|
|
| 25 Aug 2014 11:38 PM |
--Sorry, accidentally messed up the last post.
gps = game:GetService("GamePassService")
id = 000000 --id here
game.Players.PlayerAdded:connect(function(Player) Player:WaitForDataReady() if gps:PlayerHasPass(Player , id) then coroutine.resume(coroutine.create(function() while wait() do repeat wait() until Player.Character~=nil hat = game.Lighting.Hat:clone() -- change hat name and put hat in lighting hat.Parent = Player.Character end end)) end end) |
|
|
| Report Abuse |
|
|
|
| 26 Aug 2014 02:29 AM |
| ^ worked but causes lag because it does not stop being place on the cahracter |
|
|
| Report Abuse |
|
|
| |
|
| |
|