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
 

KeyDown error...

Previous Thread :: Next Thread 
Spectrial is not online. Spectrial
Joined: 15 Mar 2012
Total Posts: 3348
19 Aug 2012 12:18 PM
local deb = false
local looking = false


function Key(key)
if key then
key = string.lower(key)
if (key=="q") then
local hit = mouse.Target
local cam = game.Workspace.CurrentCamera
if hit~=nil then
if not looking then
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
cam.CameraType = "Custom"
cam.FieldOfView = 60
wait(0.05)
cam.FieldOfView = 50
wait(0.05)
cam.FieldOfView = 40
wait(0.05)
cam.FieldOfView = 30
wait(0.05)
cam.FieldOfView = 20
cam.CameraSubject = nil
cam.Focus = CFrame.new(mouse.Hit.p)
deb = true
looking = true
wait(3)
deb = false
return
else
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.Classic
cam.CameraType = "Custom"
cam.CameraSubject= game.Players.LocalPlayer.Character.Humanoid
deb = true
cam.FieldOfView = 20
wait(0.01)
cam.FieldOfView = 30
wait(0.01)
cam.FieldOfView = 40
wait(0.01)
cam.FieldOfView = 50
wait(0.01)
cam.FieldOfView = 60
wait(0.01)
cam.FieldOfView = 70
SetCursor(mouse)
looking = false
wait(3)
deb = false
return
end
end
end
end
end

function Equip(mouse)
mouse.KeyDown:connect(Key)
end

script.Parent.Equipped:connect(onEquipped)



I tried to change it from RMB to the key Q and it says event disconnected becuause of exception... Any help... anyone?
Report Abuse
Spectrial is not online. Spectrial
Joined: 15 Mar 2012
Total Posts: 3348
19 Aug 2012 12:32 PM
BUMP


please help
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