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
 

Can't figure out why this isn't working. -_-

Previous Thread :: Next Thread 
huner2 is not online. huner2
Joined: 27 Apr 2008
Total Posts: 1681
26 Feb 2013 07:35 PM
So, this is just supposed to change your stats and play a sound when you level up, but, it won't. No output.

player = script.Parent
stats = player.Stats
--
stats.XPNEEDED.Value = (stats.Level.Value * 100) --It doesn't even run this part.
function onChanged()
if stats.XP.Value >= stats.XPNEEDED.Value then
stats.Level.Value = stats.Level.Value + 1
wait()
stats.XP.Value = 0
stats.XPNEEDED.Value = (stats.Level.Value * 100)
script.LevelUpSound:Play()
end
end
stats.XP.Changed:connect(onChanged)
Report Abuse
animatedRobloxwinner is not online. animatedRobloxwinner
Joined: 28 Apr 2012
Total Posts: 997
26 Feb 2013 07:36 PM
Are ALL the variables set?
Report Abuse
huner2 is not online. huner2
Joined: 27 Apr 2008
Total Posts: 1681
26 Feb 2013 07:37 PM
Yes.
Report Abuse
animatedRobloxwinner is not online. animatedRobloxwinner
Joined: 28 Apr 2012
Total Posts: 997
26 Feb 2013 07:39 PM
Looking at the part that says
"player = script.Parent"
What object is the parent?
Report Abuse
huner2 is not online. huner2
Joined: 27 Apr 2008
Total Posts: 1681
26 Feb 2013 07:41 PM
If I were in playmode-

game
>Players
>>huner2
>>>This Script
Report Abuse
animatedRobloxwinner is not online. animatedRobloxwinner
Joined: 28 Apr 2012
Total Posts: 997
26 Feb 2013 07:44 PM
Ehm..... did you try a GetChildren script?
Report Abuse
huner2 is not online. huner2
Joined: 27 Apr 2008
Total Posts: 1681
26 Feb 2013 07:45 PM
What do you mean?
Report Abuse
animatedRobloxwinner is not online. animatedRobloxwinner
Joined: 28 Apr 2012
Total Posts: 997
26 Feb 2013 07:47 PM
GetChildren is a service that allows all of the children to be highlighted of what you selected. And FindFirstChild would have to accompany it.
Report Abuse
huner2 is not online. huner2
Joined: 27 Apr 2008
Total Posts: 1681
26 Feb 2013 07:47 PM
I know that much, I just did not understand what you meant by "GetChildren script".
Report Abuse
huner2 is not online. huner2
Joined: 27 Apr 2008
Total Posts: 1681
26 Feb 2013 07:57 PM
Bump
Report Abuse
huner2 is not online. huner2
Joined: 27 Apr 2008
Total Posts: 1681
26 Feb 2013 08:45 PM
Bump
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
26 Feb 2013 09:59 PM
Scripts and LocalScripts _WILL_NOT_ run as a direct descendant of Player.
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