|
| 02 Nov 2017 06:41 PM |
How do I make a shaking screen while running? |
|
|
| Report Abuse |
|
|
| 02 Nov 2017 06:53 PM |
Mouse.KeyDown:connect(function(Key) Key = Key:lower():byte() if Key == 119 then Up = true print('yay') end if Key == 97 then Left = true end if Key == 115 then Down = true end if Key == 100 then Right = true end if (Up or Down or Left or Right) and not Walking then Walking = true while Walking do#### #X####0.5 for i = 1, 10 do if not Walking then break end pX = pX + 0.1 pY = (math.abs(pX)^2)*3 wait(0.05) end for i = 1, 10 do if not Walking then break end pX = pX - 0.1 pY = (math.abs(pX)^2)*3 wait(0.05) end end end end)
Mouse.KeyUp:connect(function(Key) Key = Key:lower():byte() if Key == 119 then Up = false end if Key == 97 then Left = false end if Key == 115 then Down = false end if Key == 100 then Right = false end if not Up and not Down and not Left and not Right then Walking = false end end)
spawn(function() while wait() do local GuiPosition = UDim2.new(0.01, 0, .4, 0) if Up then GuiPosition = GuiPosition + UDim2.new(0, 0, 0, -10) end if Left then GuiPosition = GuiPosition + UDim2.new(0, -10, 0, 0) end if Down then GuiPosition = GuiPosition + UDim2.new(0, 0, 0, -2) end if Right then GuiPosition = GuiPosition + UDim2.new(0, 10, 0, 0) end local Bobbing = UDim2.new(0, pX*20, 0, pY*20) GuiPosition = GuiPosition + Bobbing jump=UDim2.new(0, 0, 0, Char.Humanoid.Jump and -20 or 0) Gui:TweenPosition(GuiPosition+jump, _, _, .2, true)
end end) |
|
|
| Report Abuse |
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 02 Nov 2017 06:56 PM |
| Keyboard input through mouse is deprecated and like really bad, use UserInputService and like change camera cframe and stuffs |
|
|
| Report Abuse |
|
TaaRt
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 5039 |
|
|
| 02 Nov 2017 07:34 PM |
| Is there any reason at all to change the char to its byte representation..? |
|
|
| Report Abuse |
|