Quote: "if g_KeyPressW == 1 then
LoopSound(e,2)
if g_KeyPressW == 0 then
StopSound(e,2)
PlaySound(e,3)"
you can't have both conditions true at the same time....
your code is saying "if i'm pressing W loop a sound
and if i'm also not pressing W stop that sound and play a different sound"... it doesn't make sense, you would say "if i'm pressing W loop a sound
otherwise stop that sound and play another sound"
if g_KeyPressW == 1 then
LoopSound(e,2)
else
StopSound(e,2)
PlaySound(e,3)
end
note that you will also get an issue with the sound 3 always getting played like this, you need to also add some code to check for a time only play
if g_KeyPressW == 1 then
LoopSound(e,2)
stopped_moving = 1
else
StopSound(e,2)
if stopped_moving == 1 then
PlaySound(e,3)
stopped_moving = 0
end
end