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: Why won't this award the badge?

Previous Thread :: Next Thread 
NetsFan0 is not online. NetsFan0
Joined: 17 Apr 2009
Total Posts: 2777
05 Aug 2014 10:27 PM
script.Parent.MouseButton1Click:connect(function()
local key = script.Parent.Parent.TextBox.Text
if key == ""..string.sub(script.Parent.Parent.Parent.Parent.Name, -1, -3)..""..string.sub(script.Parent.Parent.Parent.Parent.userId, -1, 1).."" then
game:GetService("BadgeService"):AwardBadge(script.Parent.Parent.Parent.Parent, 170422276)
script.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end
end)
Report Abuse
NetsFan0 is not online. NetsFan0
Joined: 17 Apr 2009
Total Posts: 2777
05 Aug 2014 10:27 PM
The if key line is one line but the forum cut it into two lines.

ɪᴛ ᴀɪɴ'ᴛ ᴇᴀsʏ, ʙᴇɪɴɢ ᴀ ɴᴀᴅᴀʟ ʜᴀᴛᴇʀ
Report Abuse
NetsFan0 is not online. NetsFan0
Joined: 17 Apr 2009
Total Posts: 2777
05 Aug 2014 10:34 PM
bump

ɪᴛ ᴀɪɴ'ᴛ ᴇᴀsʏ, ʙᴇɪɴɢ ᴀ ɴᴀᴅᴀʟ ʜᴀᴛᴇʀ
Report Abuse
2eggnog is not online. 2eggnog
Joined: 08 Nov 2008
Total Posts: 1351
05 Aug 2014 10:37 PM
It needs to be run from a server script, not a local script.
Report Abuse
NetsFan0 is not online. NetsFan0
Joined: 17 Apr 2009
Total Posts: 2777
05 Aug 2014 10:45 PM
It is in a server script. The script is in a Gui Button

ɪᴛ ᴀɪɴ'ᴛ ᴇᴀsʏ, ʙᴇɪɴɢ ᴀ ɴᴀᴅᴀʟ ʜᴀᴛᴇʀ
Report Abuse
2eggnog is not online. 2eggnog
Joined: 08 Nov 2008
Total Posts: 1351
05 Aug 2014 10:49 PM
Oh, AwardBadge's first argument needs to be the player's userId, not the player.

game:GetService("BadgeService"):AwardBadge(script.Parent.Parent.Parent.Parent.userId, 170422276)
Report Abuse
NetsFan0 is not online. NetsFan0
Joined: 17 Apr 2009
Total Posts: 2777
05 Aug 2014 10:51 PM
Thanks

ɪᴛ ᴀɪɴ'ᴛ ᴇᴀsʏ, ʙᴇɪɴɢ ᴀ ɴᴀᴅᴀʟ ʜᴀᴛᴇʀ
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