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 » Scripters
Home Search
 

Re: plays more than once

Previous Thread :: Next Thread 
GreedTaka is not online. 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
isaacsoccer is not online. isaacsoccer
Joined: 22 Jul 2010
Total Posts: 430
28 Dec 2016 01:27 AM
Make a debounce:

http://wiki.roblox.com/?title=Debounce
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
28 Dec 2016 01:28 AM
thats what Enl = true is i thought
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
28 Dec 2016 01:30 AM
is v.Exp value being fired twice?


Report Abuse
GreedTaka is not online. 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 is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
28 Dec 2016 01:37 AM
all of it is
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
28 Dec 2016 01:59 AM
b
Report Abuse
TimeTicks is not online. 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 is not online. 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 is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
28 Dec 2016 04:20 AM
b
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
28 Dec 2016 06:44 AM
b
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
28 Dec 2016 07:43 AM
b
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
28 Dec 2016 09:18 AM
b
Report Abuse
TimeTicks is not online. 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 is not online. 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 is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
28 Dec 2016 09:12 PM
b
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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