|
| 12 Jan 2014 10:00 PM |
| Its useful so I want to know the script plz :) |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 12 Jan 2014 10:18 PM |
__bookmarked__
______________ |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 12 Jan 2014 10:54 PM |
^^
why not use game.Players.LocalPlayer.Character.Humanoid :3 |
|
|
| Report Abuse |
|
|