BriGhtx3 Posted October 19, 2011 Share Posted October 19, 2011 function harndrang(Player) local harndrangZahl = getElementData(Player, "harndrang") setTimer(auffuellen, 1000, 10, Player, harndrangZahl) end function auffuellen(Player, harndrangZahler) setElementData(Player,"harndrang", tonumber(harndrangZahler+1)) end The script should set harndrang, every second +1 until it gets 10. But it sets harndrang just, +1 and then stops. Link to comment
TAPL Posted October 19, 2011 Share Posted October 19, 2011 function harndrang(Player) local harndrangZahl = tonumber(getElementData(Player, "harndrang")) setTimer(auffuellen, 1000, 10, Player, harndrangZahl) end function auffuellen(Player, harndrangZahl) setElementData(Player,"harndrang", harndrangZahl + 1) end Link to comment
Castillo Posted October 19, 2011 Share Posted October 19, 2011 function harndrang(Player) local harndrangZahl = getElementData(Player, "harndrang") setTimer(auffuellen, 1000, 10, Player, harndrangZahl) end function auffuellen(Player, harndrangZahler) setElementData(Player,"harndrang", tonumber(harndrangZahler)+1) end Link to comment
BriGhtx3 Posted October 19, 2011 Author Share Posted October 19, 2011 I already fixed it. I tried yous, doesn't work. My solution : function harndrang(Player) local harndrangZahl = getElementData(Player, "harndrang") setTimer(auffuellen, 1000, 10, Player) end function auffuellen(Player) local harndrangZahler = getElementData(Player, "harndrang") setElementData(Player,"harndrang", tonumber(harndrangZahler)+1) end Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now