Blockland Forums > Modification Help
Screwed-up Script. I require assistance.
lordician:
--- Quote from: Kike on November 17, 2010, 08:56:08 PM ---Nope. No errors. My head hurts though. ._.*
--- End quote ---
Haha, lemme look through the script one more time.
EDIT:
I think Space Guy is right and doesn't say that for fun.
Your weapon only changes image when the ammo != 0.
But i don't see that the ammo gets set on anything.
IF you use Space Guy's ammo script, you should try to do what Space Guy said.
Otherwise, set the ammo in the onmount script.
When a variable doesn't get set but is used, you get some highly unpredictable actions.
Tl;dr
The ammo clarification DOES matter since the iron sight action only executes when having ammo.
And when Space Guy says something, you can almost know he's right.
He has very much experience points in scripting. ;)
(However, even he doesn't know everything though. :P)
Kike:
--- Quote from: lordician on November 18, 2010, 05:08:20 AM ---Haha, lemme look through the script one more time.
EDIT:
I think Space Guy is right and doesn't say that for fun.
Your weapon only changes image when the ammo != 0.
But i don't see that the ammo gets set on anything.
IF you use Space Guy's ammo script, you should try to do what Space Guy said.
Otherwise, set the ammo in the onmount script.
When a variable doesn't get set but is used, you get some highly unpredictable actions.
Tl;dr
The ammo clarification DOES matter since the iron sight action only executes when having ammo.
And when Space Guy says something, you can almost know he's right.
He has very much experience points in scripting. ;)
(However, even he doesn't know everything though. :P)
--- End quote ---
Thanks again, but have you seen my updated code?
Kike:
Bump for lack of answer/explanation.
Kike:
--- Quote from: Kike on December 01, 2010, 03:04:12 PM ---Bump for lack of answer/explanation.
--- End quote ---
Space Guy:
You still have the test for %obj.toolAmmo[%obj.currTool] != 0 before it changes. You never set the ammo amount (since you've removed everything to do with that) so it's always going to be a blank string ("") which equals 0 in value. Therefore it'll never change to the iron-sight.