I want to create a helper that changes the players transparency with the press of a button. also, if the button is pressed again it should return to the original transparency here is what i got so far
[statedef 6550]
type = S
movetype= I
physics = N
velset = 0,0
anim = 66655228
[state 6550, VARIABLES OFF]
type = varset
trigger1 = 1
v = var(0)
value = 0
[state 6550]
type = changestate
triggerall = time != 0
trigger1 = parent,command = "50% transparency"
value = 6551
[statedef 6551, VARIABLES ON]
type = S
movetype= I
physics = N
velset = 0,0
anim = 66655228
[state 6551, VARIABLES ON]
type = varadd
trigger1 = 1
v = var(0)
value = 1
[state 6551]
type = changestate
triggerall = time != 0
trigger1 = parent,command = "50% transparency"
value = 6550
in the command file:
[State -1, TRANSPARENCY CONTROLLER]
type = Helper
triggerall = alive&&Roundstate=2
triggerall = numhelper(8741) = 0
trigger1 = stateno = 6062
name = "TRANSPARENCY CONTROLLER"
id = 8741
stateno = 6550
pos = 0, 0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause = 1
;persistent = 0
sprpriority = 7
The problem that i have is that when it returns to 6550 the variable doesnt set itself to 0. I dont know what might be causing it. When i press the button it changes the transparency, then when i press it again it does nothing. somebody could help me? thx