uglybad
|
  |
| Joined: 29 Aug 2007 |
| Total Posts: 1234 |
|
|
| 23 Jun 2016 04:21 PM |
I have this script that gives players an item if they own the specific gamepass. In the past I've attempted to make this work for badges, going so far as replacing every "gamepass" in the script with "badge", but to no avail. If one of you could take a look at this and tell me what I'm doing wrong, I'd be very grateful!
wait(2)
gpid = 434219967 tools = {"SAND"}
GPS = Game:GetService("GamePassService") function respawned(char) player = game.Players:FindFirstChild(char.Name) print("Respawned") if char:FindFirstChild("Head") ~= nil then print("It's a Player!") if GPS:PlayerHasPass(player, gpid) then print("Has GPID") for i = 1,#tools do game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.Backpack end else print("No GPID") end end end game.Workspace.ChildAdded:connect(respawned)
|
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 04:59 PM |
| I'm curious as to why you have wait(2) at the beginning. |
|
|
| Report Abuse |
|
|
uglybad
|
  |
| Joined: 29 Aug 2007 |
| Total Posts: 1234 |
|
|
| 23 Jun 2016 05:01 PM |
It's just to be sure the script starts working correctly in online mode, I thought the wait time would combat server lag making the script invalid. ...does it not need to be there? Anyways, do you know what I need to do to make this work for badges? This script works just fine for gamepasses but refuses to work for badge ID's, with or without modification. |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 05:05 PM |
| the wait doesn't need to be there, no. As for the main issue, give me a few minutes and I'll find out what's going on. |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 05:10 PM |
| From my understanding, in this script if the player has a certain badge, you want them to re-spawn with a special tool? |
|
|
| Report Abuse |
|
|
uglybad
|
  |
| Joined: 29 Aug 2007 |
| Total Posts: 1234 |
|
|
| 23 Jun 2016 05:12 PM |
| Exactly. The game I'm working on is a sequel, and I want the player's progress from badges and gamepasses to carry over as items they get to use. Gamepasses are no problem, but the badges are. |
|
|
| Report Abuse |
|
|