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 » Scripting Helpers
Home Search
 

Re: What's wrong?

Previous Thread :: Next Thread 
MoreMonkey8 is not online. MoreMonkey8
Joined: 13 Dec 2010
Total Posts: 1127
07 Sep 2013 08:42 PM
game:service'Players'.PlayerAdded:connect(function(p)
coroutine.wrap(function()
Gold=p:WaitForChild'PlayerGui':WaitForChild'GameGUI':WaitForChild'Gold';
if game:service'BadgeService':UserHasBadge(129091770,p) and not p:LoadBoolean('GoldGiven') then
Gold.Value=Gold.Value+20;
p:SaveBoolean('GoldGiven',true);
end;
end)();
end;


so I have a game pass for +20 gold. Gold is in StarterGui.GameGUI.Gold
I want it to only give +20 once. what's wrong?
There's also a gold cap, like I have 84/100 to test the cap, and my friend had 22/50 and it didn't give 20 to either of us... :/
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
07 Sep 2013 08:45 PM
game:service('Players').PlayerAdded:connect(function(p)
coroutine.wrap(function()
Gold=p:WaitForChild('PlayerGui'):WaitForChild('GameGUI'):WaitForChild('Gold')
if game:service('BadgeService'):UserHasBadge(129091770,p.userId) and not p:LoadBoolean('GoldGiven') then
Gold.Value=Gold.Value+20
p:SaveBoolean('GoldGiven',true)
end
end)
end)
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
07 Sep 2013 08:47 PM
Im sorry but thats the nastiest script Ive ever seen e.e
Report Abuse
MoreMonkey8 is not online. MoreMonkey8
Joined: 13 Dec 2010
Total Posts: 1127
07 Sep 2013 08:48 PM
Neither worked... qq
Report Abuse
Joshuats is not online. Joshuats
Joined: 14 May 2008
Total Posts: 847
07 Sep 2013 08:54 PM
game:GetService'Players'.PlayerAdded:connect(function(p)
coroutine.wrap(function()
local Gold=p:WaitForChild'PlayerGui':WaitForChild'GameGUI':WaitForChild'Gold';
if game:GetService'BadgeService':UserHasBadge(129091770,p) and not p:LoadBoolean('GoldGiven') then
Gold.Value=Gold.Value+20;
p:SaveBoolean('GoldGiven',true);
end;
end)();
end;
Report Abuse
Joshuats is not online. Joshuats
Joined: 14 May 2008
Total Posts: 847
07 Sep 2013 08:56 PM
Additionally... you may want to add:

'p:WaitForDataReady()' before the 'if' statement (right term? :P).
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
07 Sep 2013 09:01 PM
use mine and on the 2nd line add p:WaitForDataReady()
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
07 Sep 2013 09:02 PM
What's the point of using coroutine.wrap
Report Abuse
MoreMonkey8 is not online. MoreMonkey8
Joined: 13 Dec 2010
Total Posts: 1127
07 Sep 2013 09:08 PM
Still none work... could it be because I have 86/100 gold?
Report Abuse
MoreMonkey8 is not online. MoreMonkey8
Joined: 13 Dec 2010
Total Posts: 1127
07 Sep 2013 09:40 PM
bump/help?
Report Abuse
MoreMonkey8 is not online. MoreMonkey8
Joined: 13 Dec 2010
Total Posts: 1127
07 Sep 2013 09:53 PM
help?
Report Abuse
CrakTheRaven is not online. CrakTheRaven
Joined: 25 Dec 2009
Total Posts: 13410
07 Sep 2013 09:59 PM
Why do you need coroutine.wrap, exactly?
Report Abuse
MoreMonkey8 is not online. MoreMonkey8
Joined: 13 Dec 2010
Total Posts: 1127
07 Sep 2013 10:11 PM
Well a friend was helping me make the script and she did it that way :?
any way would be fine if it worked...
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
07 Sep 2013 10:13 PM
game:service("Players").PlayerAdded:connect(function(p)
Gold=p:WaitForChild("PlayerGui"):WaitForChild("GameGUI"):WaitForChild("Gold")
if game:service("BadgeService"):UserHasBadge(129091770,p.userId) and not p:LoadBoolean("GoldGiven1") then
Gold.Value=Gold.Value+20
p:SaveBoolean('GoldGiven1',true)
end
end)
Report Abuse
MoreMonkey8 is not online. MoreMonkey8
Joined: 13 Dec 2010
Total Posts: 1127
07 Sep 2013 10:19 PM
Still doesn't work.. :/
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
07 Sep 2013 10:23 PM
game:service("Players").PlayerAdded:connect(function(p)
p:WaitForDataReady()
Gold=p:WaitForChild("PlayerGui"):WaitForChild("GameGUI"):WaitForChild("Gold")
if game:service("BadgeService"):UserHasBadge(129091770,p.userId) and not p:LoadBoolean("GoldGiven1") then
Gold.Value=Gold.Value+20
p:SaveBoolean('GoldGiven1',true)
end
end)
Report Abuse
MoreMonkey8 is not online. MoreMonkey8
Joined: 13 Dec 2010
Total Posts: 1127
07 Sep 2013 10:28 PM
Still won't... :/....
Report Abuse
MoreMonkey8 is not online. MoreMonkey8
Joined: 13 Dec 2010
Total Posts: 1127
07 Sep 2013 10:45 PM
Help :/?
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
07 Sep 2013 10:46 PM
http://www.roblox.com/Remote-Error-Monitoring-System-item?id=65774258
Use that and see if there are any errors.
Report Abuse
MoreMonkey8 is not online. MoreMonkey8
Joined: 13 Dec 2010
Total Posts: 1127
08 Sep 2013 02:10 AM
finally figured it out, thanks.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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