555123
|
  |
| Joined: 08 Mar 2010 |
| Total Posts: 51 |
|
|
| 19 Nov 2014 04:12 AM |
local Humanoid = script.Parent.H1
function XPGive()
local tag = Humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local XP = tag.Value:findFirstChild("XP")
if XP ~= nil then
XP.Value = XP.Value + 50
wait(0.1)
script:remove()
end
end
end
end
Humanoid.Died:connect(XPGive)
It worked fine before but for some reason it broke with todays update. Any Ideas?
The "XP" object is located in the player object of the player that killed this Humanoid, And yes, The Humanoid object is named "H1" |
|
|
| Report Abuse |
|
|
hunte922
|
  |
| Joined: 28 May 2008 |
| Total Posts: 6969 |
|
|
| 19 Nov 2014 07:16 AM |
I dunno, but you need to: -Replace findFirstChild with FindFirstChild -Replace remove with Destroy |
|
|
| Report Abuse |
|
|
iondriver
|
  |
| Joined: 18 Nov 2012 |
| Total Posts: 757 |
|
|
| 19 Nov 2014 07:25 AM |
I believe that your problem is this:local XP = tag.Value:findFirstChild("XP"). Try changing it to local XP = tag:FindFirstChild("XP"). By the way, what is the hierarchy of tag and XP? Is XP an Int value or a number value parented to Tag?
|
|
|
| Report Abuse |
|
|
Ortron
|
  |
| Joined: 19 Jul 2013 |
| Total Posts: 1297 |
|
|
| 19 Nov 2014 07:39 AM |
"script:remove()"
Change to
script:Remove()
or
script:Destroy() |
|
|
| Report Abuse |
|
|