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 » Scripters
Home Search
 

I need help

Previous Thread :: Next Thread 
EdwardCastrum is not online. EdwardCastrum
Joined: 29 Jul 2015
Total Posts: 74
02 Nov 2017 06:41 PM
How do I make a
shaking screen while running?
Report Abuse
UnderWorldOnline is not online. UnderWorldOnline
Joined: 31 Dec 2010
Total Posts: 7883
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 is online. 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 is online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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