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: How does i make the shift to run script

Previous Thread :: Next Thread 
SnowyKirby is online. SnowyKirby
Joined: 15 Jan 2013
Total Posts: 68009
12 Jan 2014 10:00 PM
Its useful so I want to know the script plz :)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 10:03 PM
GetMouse method
KeyDown event
KeyUp event
Byte method (string.byte function)
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
12 Jan 2014 10:06 PM
Dang beat me to it.
Report Abuse
blockyblox1231 is not online. blockyblox1231
Joined: 31 Aug 2010
Total Posts: 156
12 Jan 2014 10:07 PM
@cnt, does it have to be in a local script inside the player for it to function properly? i think i want to do some testing with keys
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 10:09 PM
Yes, it has to be in a local script, you can't use the GetMouse method in a server-side script since that really makes no sense
Report Abuse
blockyblox1231 is not online. blockyblox1231
Joined: 31 Aug 2010
Total Posts: 156
12 Jan 2014 10:15 PM
i figured, how would you make it so that a function fires when a player presses a certain key (for example shift in this case)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 10:16 PM
mouse.KeyDown:connect(function(k)
if k:byte() == 47 or k:byte() == 48 then
--pressed right shift or left shift
end
end)
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
12 Jan 2014 10:18 PM
__bookmarked__














______________
Report Abuse
blueboy112 is not online. blueboy112
Joined: 15 Apr 2009
Total Posts: 802
12 Jan 2014 10:24 PM
http://www.roblox.com/Shift-Run-Auto-Importer-item?id=102942032

Auto-importer, buried in my models for over a year. You're welcome.

>> Schrödinger's cat walks into a bar. And doesn't.
Report Abuse
blockyblox1231 is not online. blockyblox1231
Joined: 31 Aug 2010
Total Posts: 156
12 Jan 2014 10:33 PM
I made this myself (with the help of cnt for providing me with the knowledge of byte() method)

local mouse = game.Players.LocalPlayer:GetMouse()

mouse.KeyDown:connect(function(k)
if k:byte() == 47 or k:byte() == 48 then
game.Workspace.CurrentCamera.FieldOfView = 80
script.Parent.Parent.Character.Humanoid.WalkSpeed = 32
end
mouse.KeyUp:connect(function(a)
if a:byte() == 47 or k:byte() == 48 then
game.Workspace.CurrentCamera.FieldOfView = 70
script.Parent.Parent.Character.Humanoid.WalkSpeed = 16
end
end)
end)
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
12 Jan 2014 10:54 PM
^^

why not use game.Players.LocalPlayer.Character.Humanoid
:3
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