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 » Game Design
Home Search
 

Re: I Don't understand why this doesn't work

Previous Thread :: Next Thread 
555123 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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