Jump to content

Question: How do you use operators such as + - / and * in a script


CarnivalOfFear

Recommended Posts

Question: How do you use operators such as + - / and * in a script

Im trying to make a simple counter that works once the player has completed a certain number of tasks I simply need to increase and int value by one every time a scripted action is done by the player. I cant find syntax examples anywhere.

Link to comment
Share on other sites

int iCount ; This is our counter variable we want to increase


Begin Gamemode  ;or Onload or whatever makes sense for what you're trying to do

if Whatever ;whatever conditions trigger the event being done

set iCount to iCount +1

endif

end

 

You'll probably also want some kind of variable to make sure the script only runs once only so the counter doesn't constantly go up (e.g. a bDoOnce or whatever).

Link to comment
Share on other sites

int iCount ; This is our counter variable we want to increase


Begin Gamemode  ;or Onload or whatever makes sense for what you're trying to do

if Whatever ;whatever conditions trigger the event being done

set iCount to iCount +1

endif

end

 

You'll probably also want some kind of variable to make sure the script only runs once only so the counter doesn't constantly go up (e.g. a bDoOnce or whatever).

 

figured that out. the only thing I was missing was the second x name after the to in set x to x + 1

Link to comment
Share on other sites

  • Recently Browsing   0 members

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