Jump to content

Need a little bit of help with fixing my script >:(


ABVXYzackattack

Recommended Posts

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 ZElixirTier4Script

float timer

short trippercentage

Begin Gamemode

player.triggerhitshader 25

if timer == 0

set timer to (timer + GetSecondsPassed)

endif

if timer >= 10

set trippercentage to GetRandomPercent

if trippercentage >= 60

player.pushactoraway player 1

set trippercentage to 0

endif

set timer to 0

endif

End

Begin Scripteffectfinish

player.triggerhitshader 0

player.removespell ZElixirTier4

End

 

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...