I'm trying to make a projectile cog so that when you press space on it, it gets attached to the player. This is what I tried:
but nothing happens when I press it. Its based on a walkstruct, so would that be the problem?
Code:
symbols message activated int holding=0 end code activated: player = GetLocalPlayerThing(); if(holding==1); { DetachThing(GetSenderRef()); holding = 0; } else { AttachThingToThingEx(GetSenderRef(), player, 0x8); holding = 1; } return; end
but nothing happens when I press it. Its based on a walkstruct, so would that be the problem?