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 » Game Design
Home Search
 

Re: Doesn't Work - And is there a more efficient way?

Previous Thread :: Next Thread 
DevSyntax is not online. DevSyntax
Joined: 29 Oct 2011
Total Posts: 1643
24 Sep 2015 06:39 PM
I have a button that changes the camera when you either click it or press TAB... There is probably a more efficient way, but I'm currently spacing out. (Also it doesn't work, but it probably is some stupid mistake)

local clicked = false
local camera = 0
function customize()
if clicked == false then
clicked = true
script.Parent.Text = "X (Press Tab To Change)"
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
game.Players.LocalPlayer.PlayerGui.Shoulder.Disabled = true
camera = 1
else
clicked = false
script.Parent.Text = ""
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
game.Players.LocalPlayer.PlayerGui.Shoulder.Disabled = false
camera = 0
end
end

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

mouse.KeyDown:connect(function(key)
if key:byte() == 9 then --spacebar is 32
if camera == 0 then
print("Changing Camera")
script.Parent.Text = "X (Press Tab To Change)"
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
game.Players.LocalPlayer.PlayerGui.Shoulder.Disabled = true
camera = 1
elseif camera == 1 then
script.Parent.Text = ""
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
game.Players.LocalPlayer.PlayerGui.Shoulder.Disabled = false
camera = 0
end
end
end)


script.Parent.MouseButton1Click:connect(customize)
Report Abuse
DevSyntax is not online. DevSyntax
Joined: 29 Oct 2011
Total Posts: 1643
24 Sep 2015 07:27 PM
Bump
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
24 Sep 2015 07:41 PM
KeyDown? o.O
Report Abuse
DevSyntax is not online. DevSyntax
Joined: 29 Oct 2011
Total Posts: 1643
24 Sep 2015 09:34 PM
Nevermind fixed it
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
24 Sep 2015 09:36 PM
Nice. What's it for?
Report Abuse
DevSyntax is not online. DevSyntax
Joined: 29 Oct 2011
Total Posts: 1643
24 Sep 2015 09:37 PM
A Sword Fighting game for a group, I have no game ideas ATM.
If you'd be interested in working on a game, let me know! :)
I'd like to
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
24 Sep 2015 09:37 PM
Maybe. What's your skype?
Report Abuse
DevSyntax is not online. DevSyntax
Joined: 29 Oct 2011
Total Posts: 1643
24 Sep 2015 09:40 PM
Sent PM
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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