Author Topic: Event_Variable HELP  (Read 1265 times)

I just got Event_Variables and I was making an olden days RPG
Like you click on a tree and it dissapears and you get 1 wood.

So I made a river with fish in it. When you get the fish you have to find a fire and cook them
I wanted for it to say "You dont have a fish to cook" if you have 0. and when it hit 0 it just goes

Raw Fish is -1
Cooked Fish is 1

How do I make it stop at 0?



on activate -> self -> checkvariable -> fish equal 0?


where is CheckVariable?

I dont think its that...PLEASE HELP

i was wrong, its ifvariable

0_onactivate>self>ifvariable>player_doesnotequal[0]
0_onvariabletrue>player>addvariable[rawfish][-1]
0_onvariabletrue>player>addvariable[cookedfish][1]
0_onvariablefalse>client>centerprint>[(color:ffffff)You don't have any fish to cook!]

and so on..., and the chat message will come out white also

AWESOME THANK YOU!
PS. I know FF color codes -.-

Quote
AWESOME THANK YOU!
PS. I know FF color codes -.

Wait does it work? I don't think that would work... I tryed it it does'nt do anything...

Here add this to whatever cooks the fish.
Let me know if it worked.

Quote
delay[0]       onActivate -> Self -> ifVariable -> [Client] Raw Fish [GreaterEquals] 1

delay[0]       VariableTrue -> Self -> setRaycasting [ ]

delay[0]       VariableTrue -> Client -> AddVariable -> [Client] Cooked Fish [1]

delay[0]       VariableTrue -> Client -> AddVariable -> [Client] Subtract [1]

delay[0]       VariableTrue -> Self -> SubVarFromVar ->  [Client] Raw Fish [Client] Subtract

delay[0]       VariableTrue -> Client -> displayVariable -> BottomPrint -> Raw Fish [3]

delay[0]       VariableTrue -> Client -> CenterPrint -> You have cooked fish! [3]

delay[3000] VariableTrue -> Client -> displayVariable -> BottomPrint -> Cooked Fish

delay[3000] VariableTrue -> Client -> setVariable -> Subtract 0

delay[3000] VariableTrue -> Self -> setRaycasting

*


delay[0]       VariableFalse -> Client -> centerPrint -> You don't have a fish to cook [3]

^if you use his suggestion it will work for sure

greater equals works too, but both work

Im trying
Quote
delay[0]       onActivate -> Self -> ifVariable -> [Client] Raw Fish [GreaterEquals] 1

delay[0]       VariableTrue -> Self -> setRaycasting [ ]

delay[0]       VariableTrue -> Client -> AddVariable -> [Client] Cooked Fish [1]

delay[0]       VariableTrue -> Client -> AddVariable -> [Client] Subtract [1]

delay[0]       VariableTrue -> Self -> SubVarFromVar ->  [Client] Raw Fish [Client] Subtract

delay[0]       VariableTrue -> Client -> displayVariable -> BottomPrint -> Raw Fish [3]

delay[0]       VariableTrue -> Client -> CenterPrint -> You have cooked fish! [3]

delay[3000] VariableTrue -> Client -> displayVariable -> BottomPrint -> Cooked Fish

delay[3000] VariableTrue -> Client -> setVariable -> Subtract 0

delay[3000] VariableTrue -> Self -> setRaycasting

*


delay[0]       VariableFalse -> Client -> centerPrint -> You don't have a fish to cook [3]
Right now

I dont think that works.. 0.0

I tested it myself, it does work.

You need to set the Var's correctly.