GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
|
| 28 Dec 2016 01:26 AM |
for i,v in pairs (plrInv:GetChildren()) do local oldValue=v.Exp.Value v.Exp.Changed:connect(function(Exp) if v.Name ~= "healthPoints" then local dValue= v.Exp.Value - oldValue oldValue=Exp player.PlayerGui.MainGui.Main.frm_hover2.Interact.Text = tostring(" + "..dValue..(" ")..v.Name..(" Exp")) for i=1, 10 do wait(.1) player.PlayerGui.MainGui.Main.frm_hover2.Interact.TextTransparency = player.PlayerGui.MainGui.Main.frm_hover2.Interact.TextTransparency -0.1 end for i=1, 10 do wait(.1) player.PlayerGui.MainGui.Main.frm_hover2.Interact.TextTransparency = player.PlayerGui.MainGui.Main.frm_hover2.Interact.TextTransparency +0.1 end end if Exp >= v.ExpNeeded.Value and Enl == true then Enl = false player.PlayerGui.MainGui.Main.frm_levelup.Skill.Image = Decals[v.Name] local Text = "Well done! You have leveled up'd in "..v.Name.."!" player.PlayerGui.MainGui.Main.frm_levelup.TextLabel.Text = Text player.PlayerGui.MainGui.Main.frm_levelup.Visible = true; print(v.Level.Value.." New Level in "..v.Name) v.Exp.Value = 0 wait() print'Leveling up' v.Level.Value = v.Level.Value + 1 v.ExpNeeded.Value = (calculateLevel(v.Level.Value)) Enl = true print(v.Name.. v.ExpNeeded.Value..' Needed') end
levels up like twice when its only supposed to once
and prints twice |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2016 01:27 AM |
Make a debounce:
http://wiki.roblox.com/?title=Debounce |
|
|
| Report Abuse |
|
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
|
| 28 Dec 2016 01:28 AM |
| thats what Enl = true is i thought |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 28 Dec 2016 01:30 AM |
is v.Exp value being fired twice?
|
|
|
| Report Abuse |
|
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
|
| 28 Dec 2016 01:36 AM |
only does it sometimes
ye it is ticks |
|
|
| Report Abuse |
|
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
| |
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 28 Dec 2016 02:04 AM |
well dont let it fire more than once
|
|
|
| Report Abuse |
|
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
|
| 28 Dec 2016 02:16 AM |
| its not on purpose. .should only fire once |
|
|
| Report Abuse |
|
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
| |
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
| |
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
| |
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 28 Dec 2016 09:52 AM |
"it should only fire once"
Obviously.
Something is changing the value twince. So go and find out where, and fix it. This is something that can only be fixed by you. Its not roblox's fault.
|
|
|
| Report Abuse |
|
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
|
| 28 Dec 2016 01:53 PM |
v.Exp.Changed:connect(function(Exp)
exp is givin slow
its in this script lol it only goes over when it levels up
if Exp >= v.ExpNeeded.Value
|
|
|
| Report Abuse |
|
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
| |
|