LOLDarth
|
  |
| Joined: 19 Jun 2012 |
| Total Posts: 59 |
|
|
| 23 Jun 2012 06:02 PM |
asdfghjkl if x = 100, then x^3 is supposed to = 1000000 so in this script, x = currlevel and it returns x^3 which should be 100x100x100 = 1000000 BUT there seems to be a hidden equation in the script so it doesn't equal to 1000000.. I'm not so great at math so I can't really find it on my own.
local Player = script.Parent.Parent.Parent.Parent.Parent local XP = Player.orangejuice.XP local Level = Player.orangejuice.Level local bar = script.Parent.BAR
GetExpNeeded = function(CurrLevel) local x = CurrLevel return x^3 end
GetTotalLevelXP = function(Level) local total = 0 for i = Level-1, 1, -1 do total = total + GetExpNeeded(i) end return total end
CalcExpPercent = function(CurrLevel, CurrXp) if (CurrLevel==1) then local ratio = CurrXp/GetExpNeeded(CurrLevel) return ratio>1 and 1 or ratio else local ratio = (CurrXp-GetTotalLevelXP(CurrLevel))/GetExpNeeded(CurrLevel) --print(ratio,"=",(CurrXp-GetTotalLevelXP(CurrLevel)),":",GetExpNeeded(CurrLevel)) return ratio>1 and 1 or ratio end end
Level.Changed:connect(function() bar.Parent.Lvl.Text = "Leveled Up! ("..Level.Value..")" for i = 1, 5 do bar.Parent.BorderColor3 = Color3.new(1, 0, 0) bar.Parent.Lvl.TextColor3 = Color3.new(1, 0, 0) wait(0.2) bar.Parent.BorderColor3 = BrickColor.new(1).Color bar.Parent.Lvl.TextColor3 = BrickColor.new(1).Color wait(0.2) end local xScale = CalcExpPercent(Level.Value, XP.Value) bar.Position = UDim2.new(-1+xScale, 2, 0, 2) bar.Parent.BorderColor3 = Color3.new(1, 204/255,0) bar.Parent.Lvl.TextColor3 = BrickColor.new(1).Color bar.Parent.Lvl.Text = "Level "..Level.Value if Level.Value >= 100 then script:remove() end end)
XP.Changed:connect(function() local xScale = CalcExpPercent(Level.Value, XP.Value) bar.Position = UDim2.new(-1+xScale, 2, 0, 2) if (xScale==1) then Level.Value = Level.Value + 1 end end)
local scale = CalcExpPercent(Level.Value, XP.Value) bar.Position = UDim2.new(-1+scale, 2, 0, 2) bar.Parent.BorderColor3 = Color3.new(1, 204/255,0) bar.Parent.Lvl.TextColor3 = BrickColor.new(1).Color bar.Parent.Lvl.Text = "Level "..Level.Value |
|
|
| Report Abuse |
|
|
LOLDarth
|
  |
| Joined: 19 Jun 2012 |
| Total Posts: 59 |
|
|
| 23 Jun 2012 06:54 PM |
| I would appreciate a fix now... I have nothing else to do. |
|
|
| Report Abuse |
|
|
LOLDarth
|
  |
| Joined: 19 Jun 2012 |
| Total Posts: 59 |
|
| |
|
|
| 23 Jun 2012 08:13 PM |
| Where'd you get this free model from? |
|
|
| Report Abuse |
|
|
LOLDarth
|
  |
| Joined: 19 Jun 2012 |
| Total Posts: 59 |
|
| |
|
|
| 23 Jun 2012 08:41 PM |
@Flappy - Burned. :P
@LOLDarth - Wouldn't it make more sense to ask him?
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook |
|
|
| Report Abuse |
|
|
LOLDarth
|
  |
| Joined: 19 Jun 2012 |
| Total Posts: 59 |
|
|
| 23 Jun 2012 08:42 PM |
:P fine... but last time I checked this forum was called "Scripting Helpers." Which, in the description clearly says: "Need to edit an existing script?" And I need help editing an existing script. |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2012 08:45 PM |
@LOLDarth - True, but this forum is generally used as a last resort. And seeing as he made the script, I would figure it more reliable to ask him.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook |
|
|
| Report Abuse |
|
|
LOLDarth
|
  |
| Joined: 19 Jun 2012 |
| Total Posts: 59 |
|
|
| 23 Jun 2012 08:52 PM |
I figured it out. :P The script was doing x^3 + currexp |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2012 09:02 PM |
Electric, burned. :P.
Sound familiar? XD. |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2012 09:05 PM |
I didn't get burned. I'm looking at you right now, and I see burned ashes that were burned from the ashes that were you.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Jun 2012 09:08 PM |
:)
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2012 09:19 PM |
| I think you're on weed, XD. |
|
|
| Report Abuse |
|
|