noone334
|
  |
| Joined: 02 Aug 2011 |
| Total Posts: 2454 |
|
|
| 18 Dec 2012 11:10 AM |
I'm trying to fix this script, it's supposed to award a badge when a humanoid is killed. Could someone help?
local Humanoid = script.Parent.Humanoid function killed() local tag = Humanoid:findFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local p = game.Players:GetPlayerFromCharacter(script.Parent) if (p ~= nil) then print("Awarding BadgeID: " ..script.Parent.BadgeID.Value .. " to UserID: " .. p.userId) local b = game:GetService("BadgeService") b:AwardBadge(p.userId, script.Parent.BadgeID.Value) end end end end Humanoid.Died:connect(killed) |
|
|
| Report Abuse |
|
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 18 Dec 2012 11:13 AM |
local Humanoid = script.Parent.Humanoid
Humanoid.Died:connect(function() local tag = Humanoid:findFirstChild("creator") if tag then if tag.Value then local p = game.Players:GetPlayerFromCharacter(script.Parent) if p then print("Awarding BadgeID: "..script.Parent.BadgeID.Value.." to UserID: "..p.userId) local b = game:GetService("BadgeService") b:AwardBadge(p.userId, script.Parent.BadgeID.Value) end end end end)
--What does the output say when you try running this? Any problems? |
|
|
| Report Abuse |
|
|
noone334
|
  |
| Joined: 02 Aug 2011 |
| Total Posts: 2454 |
|
| |
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 18 Dec 2012 11:36 AM |
| I take that as a "Woot it works! I love Jelly134 forever!" :P |
|
|
| Report Abuse |
|
|
noone334
|
  |
| Joined: 02 Aug 2011 |
| Total Posts: 2454 |
|
| |
|
noone334
|
  |
| Joined: 02 Aug 2011 |
| Total Posts: 2454 |
|
|
| 18 Dec 2012 03:08 PM |
| Uh, it doesn't seem too be working anymore, is there anything I should do with it or the humanoid? |
|
|
| Report Abuse |
|
|
noone334
|
  |
| Joined: 02 Aug 2011 |
| Total Posts: 2454 |
|
|
| 19 Dec 2012 06:55 PM |
| The output says disconnected event because of an exception. |
|
|
| Report Abuse |
|
|