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: If you wanted a keydown script to work

Previous Thread :: Next Thread 
1Riblock1 is not online. 1Riblock1
Joined: 02 May 2011
Total Posts: 4771
13 Oct 2014 06:06 PM
Where would you put it? I never managed to set it in stone for myself.
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
13 Oct 2014 06:06 PM
You put it in the script, not the rock.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
13 Oct 2014 06:06 PM
It has to be in a localscript, or connected to a tool somehow
Report Abuse
1Riblock1 is not online. 1Riblock1
Joined: 02 May 2011
Total Posts: 4771
13 Oct 2014 06:09 PM
This specifically affects the camera, but as an example, where would you put a sprint script that affects you whether you're using a tool or not?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
13 Oct 2014 06:10 PM
Localscript > PlayerGui
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
13 Oct 2014 06:11 PM
StarterGui as localscript
Report Abuse
1Riblock1 is not online. 1Riblock1
Joined: 02 May 2011
Total Posts: 4771
13 Oct 2014 06:19 PM
player = game.Players.LocalPlayer
character = player.Character
mouse = player:GetMouse()

mouse.KeyDown:connect(function(key)
if key:byte():lower() == 99 then
if player.CameraMode == "LockFirstPerson" then
player.CameraMode = "Classic"
player.CameraMinZoomDistance = 11
player.CameraMaxZoomDistance = 11
workspace.CurrentCamera.Focus = mouse.Hit
else
player.CameraMode = "LockFirstPerson"
end
end
end)

Supposed to be like what c does with the camera in a game; if it's not too much work, is this fixable?
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