|
| 16 Feb 2014 08:29 PM |
mouse=game.Players.LocalPlayer:GetMouse()
wup=true sup=true dup=true aup=true
debounce=true
mouse.KeyDown:connect(function(key) print(key.." down") if key=="w" then wup=false elseif key=="s" then sup=false elseif key=="d" then dup=false elseif key=="a" then aup=false end -- mouse.KeyUp:connect(function(key2) print(key2.." up") if key2=="w" then wup=true elseif key2=="s" then sup=true elseif key2=="d" then dup=true elseif key2=="a" then aup=true end end) while wup==false or sup==false or dup==false or aup==false do wait() if key=="w" then while wup==false do wait() script.Parent.bg.char.Position=script.Parent.bg.char.Position-UDim2.new(0,0,0,6) end elseif key=="s" then while sup==false do wait() script.Parent.bg.char.Position=script.Parent.bg.char.Position+UDim2.new(0,0,0,6) end elseif key=="d" then while dup==false do wait() script.Parent.bg.char.Position=script.Parent.bg.char.Position+UDim2.new(0,6,0,0) end elseif key=="a" then while aup==false do wait() script.Parent.bg.char.Position=script.Parent.bg.char.Position-UDim2.new(0,6,0,0) end end end end) -- -- The character moves correctly. But if I push WASD too fast the character speed gets faster. How could I prevent this? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 16 Feb 2014 08:33 PM |
myTableOfBools = {
wup=true; sup=true; dup=true; aup=true;
}
Medium Script0r |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2014 08:34 PM |
and to find your bool:
print(myTableOfBools[2]) - prints #2 in your table
idk if it prints the bool true or if it prints the stringvalue of it.. xd
Medium Script0r |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2014 08:49 PM |
| lol, I know how to use tables. But thanks xD |
|
|
| Report Abuse |
|
|