# Help using hint to show current weapon

i cant figure out how to use hint to display my current weapon. it currently just spams and i think its due the the interval. here part of the code

if (R & ~R) {Weapon +=1} elseif (Weapon > 3) {Weapon = 0}
if (Weapon == 0 ) {if (Lc) {Turret=1}else{Turret=0}}
elseif (Weapon==1) {if (Lc) {Forcer=1}elseif(Rc){Forcer=-1}
else{Forcer=0}}
elseif (Weapon ==2) {if(Lc) {Fire=1}else{Fire=0}}
elseif (Weapon ==3){if (Lc){Graber=1}elseif(Rc){Graber=0}}

if (Weapon==0){hint(“Turret”,3)}

but that just spams. any one have any ideas

I optimized your code, and also added the part you were missing.

Weapon += (~R & R)
if (Weapons > 3) {Weapon = 0}
Turret = (Weapon == 0 & Lc)
Forcer = (Weapon == 1 & Lc)
Fire = (Weapon == 2 & Lc)
Grabber = (Weapon == 3 & Lc)
if (changed(Weapon)) { #This is the part you were missing: changed()
#This wierd code: ( Stuff ? Things : OtherStuff ) works exactly like an if then else.
#Like so: ( If ? Then : Else )
hint( ( (Weapon == 0) ? "Turret" : (Weapon == 1) ? "Forcer" : (Weapon == 2) ? "igniter" : "Grabber" ) ,3)
}

thanks for the help with the hint but your code doesnt work for hint or the weapon changing. Weapon += R with interval on just makes it scroll though. and i have 4 outputs not 3.

Ah ok. Fixing the scrolling problem.

Edited the code. I think that should work better.