Cubescript Syntax?
Posted: March 25th, 2011, 3:05 pm
I pasted some code below. This is my .cfg file. I am trying to make it where when you walk up to npcman the first time that he ask you to pick up 5 apples from around the map for you. Then after that he ask you to bring him the apples. Just trying to get use to the if statements. Any help please?
on_start = [
approach = 2
echo $approach
]
level_trigger_1 = [
echo "You just picked up an apple"
]
level_trigger_2 = [
if ( $approach = 2) [
showgui npc1
approach = 3
echo $approach
]
if ( $approach = 3) [
showgui npc2
echo $approach
]
]
newgui npc1 [
guitext "I have lost 5 apples. Can you please find five apples on the map and bring them to me?"
guibutton "Close" [cleargui]
]
newgui npc2 [
guitext "Please bring me some apples"
guibutton "Close" [cleargui]
]
on_start = [
approach = 2
echo $approach
]
level_trigger_1 = [
echo "You just picked up an apple"
]
level_trigger_2 = [
if ( $approach = 2) [
showgui npc1
approach = 3
echo $approach
]
if ( $approach = 3) [
showgui npc2
echo $approach
]
]
newgui npc1 [
guitext "I have lost 5 apples. Can you please find five apples on the map and bring them to me?"
guibutton "Close" [cleargui]
]
newgui npc2 [
guitext "Please bring me some apples"
guibutton "Close" [cleargui]
]