generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Moving Glitch

Previous Thread :: Next Thread 
badguy1233 is not online. badguy1233
Joined: 23 Jul 2009
Total Posts: 885
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
badguy1233 is not online. badguy1233
Joined: 23 Jul 2009
Total Posts: 885
16 Feb 2014 08:29 PM
This is a Gui based game.
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
16 Feb 2014 08:30 PM
Use a table.
Report Abuse
badguy1233 is not online. badguy1233
Joined: 23 Jul 2009
Total Posts: 885
16 Feb 2014 08:32 PM
Use it how so?
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
16 Feb 2014 08:33 PM
myTableOfBools = {

wup=true;
sup=true;
dup=true;
aup=true;

}

Medium Script0r
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
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
badguy1233 is not online. badguy1233
Joined: 23 Jul 2009
Total Posts: 885
16 Feb 2014 08:49 PM
lol, I know how to use tables. But thanks xD
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image