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
 

Re: Not Working

Previous Thread :: Next Thread 
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 09:22 AM
Whats wrong with my level script???

--[[Level / EXP Script]]--

Lv = script.Parent.Parent.Level
EXP = script.Parent
MAXEXP = script.Parent.Parent:findFirstChild("Max Experience")

EXP.Changed:connect(function(LevelingSystem)
if EXP.Value <= 5304800 and Lv.Value <= 50 then

if Lv.Value == 1 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 4000
end

if Lv.Value == 2 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 5350
end

if Lv.Value == 3 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 8330
end

if Lv.Value == 4 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 12440
end

if Lv.Value == 5 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 17280
end

if Lv.Value == 6 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 23470
end

if Lv.Value == 7 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 31730
end

if Lv.Value == 8 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 40560
end

if Lv.Value == 9 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 50780
end

if Lv.Value == 10 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 62310
end

if Lv.Value == 11 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 75070
end

if Lv.Value == 12 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 88980
end

if Lv.Value == 13 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 103960
end

if Lv.Value == 14 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 120740
end

if Lv.Value == 15 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 138400
end

if Lv.Value == 16 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 157650
end

if Lv.Value == 17 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 177590
end

if Lv.Value == 18 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 198910
end

if Lv.Value == 19 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 226050
end

if Lv.Value == 20 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 261650
end

if Lv.Value == 21 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 354710
end

if Lv.Value == 22 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 413460
end

if Lv.Value == 23 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 477280
end

if Lv.Value == 24 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 547120
end

if Lv.Value == 25 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 623980
end

if Lv.Value == 26 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 646400
end

if Lv.Value == 27 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 719200
end

if Lv.Value == 28 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 796800
end

if Lv.Value == 29 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 879200
end

if Lv.Value == 30 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 967200
end

if Lv.Value == 31 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 1060800
end

if Lv.Value == 32 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 1159200
end

if Lv.Value == 33 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 1264000
end

if Lv.Value == 34 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 1375200
end

if Lv.Value == 35 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 1492800
end

if Lv.Value == 36 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 1616800
end

if Lv.Value == 37 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 1747200
end

if Lv.Value == 38 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 1885600
end

if Lv.Value == 39 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 2130400
end

if Lv.Value == 40 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 2379200
end

if Lv.Value == 41 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 2641600
end

if Lv.Value == 42 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 2918400
end

if Lv.Value == 43 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 3209600
end

if Lv.Value == 44 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 3516800
end

if Lv.Value == 45 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 3839200
end

if Lv.Value == 46 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 4179200
end

if Lv.Value == 47 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 4536000
end

if Lv.Value == 48 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 4910400
end

if Lv.Value == 49 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 5304800
end
end
end)
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 09:25 AM
It looks a lot longer but its really just Copy / Paste / Change Values
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 09:48 AM
Bump
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 09:51 AM
--[[BUMP]]--
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 09:52 AM
Table = {Bump, Please, Help, I, Don't, See, The, Error}

for i = 1, #Table do
Print(Table[i])
end
Report Abuse
justgoaway1 is not online. justgoaway1
Top 100 Poster
Joined: 21 Jun 2007
Total Posts: 12268
14 Jul 2011 09:54 AM
Everything.
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 09:55 AM
how about you just go away?
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 09:57 AM
I am just going to keep bumping until I get an answer...
Report Abuse
justgoaway1 is not online. justgoaway1
Top 100 Poster
Joined: 21 Jun 2007
Total Posts: 12268
14 Jul 2011 09:59 AM
Then you'll never get an answer.
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 09:59 AM
Bump Again :3
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 10:01 AM
B-U-M-P of E-P-I-C-N-E-S-S
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 10:04 AM
Bump Again...
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 10:12 AM
Bump
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 10:15 AM
EPIC FAIC!
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 10:17 AM
!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!...!
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 10:36 AM
B U M P OF S O M E T H A N G
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
14 Jul 2011 10:36 AM
Prince do you have any output?
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 10:38 AM
No sir...
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
14 Jul 2011 10:40 AM
Just one thing you might not even noticed. The function you're using is called an anonymous function, therefore you don't give it a name and where you have LevelingSystem is where there should be the arguments.
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 10:41 AM
This is the key scripting...

Lv = script.Parent.Parent.Level
EXP = script.Parent
MAXEXP = script.Parent.Parent:findFirstChild("Max Experience")

EXP.Changed:connect(function(LevelingSystem)
if EXP.Value <= 5304800 and Lv.Value <= 50 then

if Lv.Value == 1 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 4000
end
end
end)
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
14 Jul 2011 10:47 AM
Can you tell me what you want it to do? from what I understood from your script it's to change the Level depending on your XP right?
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
14 Jul 2011 10:55 AM
Even though you copied, pasted, and changed each section of that, it could be tons more efficient. Just make a table.

Library = {[1]=4000,[2]=5350, etc.}
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 11:18 AM
These parts are when the level is a # and EXP is greater then MAXEXP then levels value is added by 1 then the EXP value is subtracted by MAXEXP then MAXEXP is changed to the next requirement of EXP...

if Lv.Value == 1 and EXP.Value >= MAXEXP.Value then
Lv.Value = Lv.Value + 1
EXP.Value = EXP.Value-MAXEXP.Value
MAXEXP.Value = 4000
end
end
end)
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
14 Jul 2011 01:06 PM
Bumping cause I need help...
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