|
| 11 May 2015 06:27 PM |
if script.Parent.Parent:FindFirstChild("leaderstat") ~= nil then if script.Parent.Parent.leaderstat:findFirstChild("EXP") ~= nil then if script.Parent.Parent.leaderstat.EXP.Value < 0 then script.Parent.Parent.leaderstat.EXP.Value = script.Parent.Parent.Level.Value * 60 if script.Parent.Parent.Character:findFirstChild("Humanoid") ~= nil then if script.Parent.parent.leaderstat:findFirstChild("Level") ~= nil then script.Parent.Parent.leaderstat.Level.Value = script.Parent.Parent.Level.Value + 1
This is my level up system. It is a script placed in the StarterPack. I want to know if it will do this:
When a persons EXP becomes less than zero, their EXP's new value becomes the players level value, times 60. Then, their level is increased by 1.
What do you think of my script? Will it work? Will it glitch/fail or not work? Thanks for the feedback! If you don't think this would work, then please try to correct it for me or give me pointers! Thanks again!
-Theninjaguy987 |
|
|
| Report Abuse |
|
|
|
| 11 May 2015 06:28 PM |
Wait, did you say you inserted a script in the starter pack?
|
|
|
| Report Abuse |
|
|
|
| 11 May 2015 06:29 PM |
| In my experience the starter pack is strictly for tools and you should bind this to an event. |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 11 May 2015 06:32 PM |
if script.Parent.Parent:FindFirstChild'leaderstat' then local A = script.Parent.Parent.leaderstat:FindFirstChild'EXP' if A then if A.Value < 0 then A.Value = script.Parent.Parent.Level.Value * 60 if script.Parent.Parent.Character:FindFirstChild'Humanoid' then local B = script.Parent.parent.leaderstat:FindFirstChild'Level' if B then B.Value = script.Parent.Parent.Level.Value + 1
>add your ends |
|
|
| Report Abuse |
|
|
|
| 11 May 2015 06:36 PM |
@ mycheeze
So, that will work if it just sits in the players starterpack, every time their EXP goes below zero? |
|
|
| Report Abuse |
|
|
| |
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 11 May 2015 07:01 PM |
I r nawt sur, lemme run dis k?
qq |
|
|
| Report Abuse |
|
|
| |
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 11 May 2015 07:13 PM |
local P = game.Players.LocalPlayer local C = P.Character or P.CharacterAdded:wait() local leaderstat = P:WaitForChild'leaderstat' local EXP = leaderstat:WaitForChild'EXP' local Level = leaderstat:WaitForChild'Level' local Level2 = P:WaitForChild'Level'
EXP.Changed:connect(function() if Level2 then if EXP then if EXP.Value < 0 then EXP.Value = Level2.Value * 60 if C then if Level then Level.Value = Level2.Value + 1 end end end end end end)
This should be correct
>that is if EXP and Level are inside the leaderstat instance as well as level and if leaderstat' and the other 'Level' are inside the player |
|
|
| Report Abuse |
|
|