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
|
  |
| 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
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 2194 |
|
| |
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 5320 |
|
| |
|