ABVXYzackattack Posted December 28, 2011 Share Posted December 28, 2011 Hey I've been working on a mod of mine that adds an elixir that gets you more and more drunk the more you drink it. I have one of the tiers here. The effect I'm having issues with involves the part where once every ten seconds, it generates a random percent to make your character trip. Here's what it looks like: scn ZElixirTier4Scriptfloat timershort trippercentageBegin Gamemodeplayer.triggerhitshader 25if timer == 0set timer to (timer + GetSecondsPassed)endifif timer >= 10set trippercentage to GetRandomPercentif trippercentage >= 60player.pushactoraway player 1set trippercentage to 0endifset timer to 0endifEndBegin Scripteffectfinishplayer.triggerhitshader 0player.removespell ZElixirTier4End I compressed everything on this page so it doesn't take up as much room here. Any ideas how I can fix it to make give you a 40% chance to fall over once every ten seconds? Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted December 28, 2011 Share Posted December 28, 2011 From what I can see the timer will only advance once when it's == 0, after this never again. It is not really reliable how many seconds will pass until the GameMode block of this Spell script runs again, but I doubt it will take more than 10 seconds, and as such the condition for the calculation of the trip chance is already never met. Was the timer advancement put into this "== 0" condition for any purpose? Link to comment Share on other sites More sharing options...
Recommended Posts