generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Game Design
Home Search
 

Re: Retooling a Gamepass Item Script for Badges

Previous Thread :: Next Thread 
uglybad is not online. 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
loterman23 is online. loterman23
Joined: 06 Apr 2008
Total Posts: 178
23 Jun 2016 04:59 PM
I'm curious as to why you have wait(2) at the beginning.
Report Abuse
uglybad is not online. 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
loterman23 is online. loterman23
Joined: 06 Apr 2008
Total Posts: 178
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
loterman23 is online. loterman23
Joined: 06 Apr 2008
Total Posts: 178
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image