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: Badge Giving Command, Help needed.

Previous Thread :: Next Thread 
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
11 Aug 2012 08:07 AM
I've edited this into a command script. It's not working and there is no possible way to see what is wrong because I can't test it in the output.
It may be the "player" part on line 5 and 7 that is messing it up.

if string.sub(string.lower(msg),1,8) == "license/" then
local player = findplayer(string.sub(msg,9),speaker)
if player ~= 0 then
for i = 1,#player do
print("Awarding BadgeID: " ..script.BadgeID.Value .. " to UserID: " .. player.userId)
local b = game:GetService("BadgeService")
b:AwardBadge(player.userId, script.BadgeID.Value)
end
end end
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
11 Aug 2012 08:47 AM
Bump, the first 4 lines are good i'm guessing.
Report Abuse
cart6157 is not online. cart6157
Joined: 28 Feb 2009
Total Posts: 2194
11 Aug 2012 08:51 AM
Umm output?
Report Abuse
cart6157 is not online. cart6157
Joined: 28 Feb 2009
Total Posts: 2194
11 Aug 2012 08:53 AM
Line three I think, instead of zero use nil
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
11 Aug 2012 10:00 AM
no it's 0. Like i said, i can't use the output because they are speech commands.
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
11 Aug 2012 10:05 AM
You can!
If there is a admin list, add "Player" to the list.
Start server then start player.
Put the server + player screens side by side.
Type "game.Players.Player:SetSuperSafeChat(false)" without the "s in the command bar in the output window on the server screen.
Say the command in the player screen
What does the output say?
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
11 Aug 2012 10:36 AM
Thanks!

The output says this.


Workspace.Commands: attempt to concatenate field 'userId' (a nil value)

Which is probably because of the word "player" in the script... What can i replace it with so that the script can find the persons UserID?
Report Abuse
nickbricknick464 is not online. nickbricknick464
Joined: 22 Aug 2008
Total Posts: 8302
11 Aug 2012 10:48 AM
player.userId is the valid name

Check the player variable points to the players Player Object
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
11 Aug 2012 10:53 AM
I was hoping you would check that for me. From what i can see it does, because someone types in the name and then the word "player" gets assigned to what the person typed in.
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
11 Aug 2012 11:19 AM
Anymore help guys?
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