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: Locking first person and to stop the glitches:

Previous Thread :: Next Thread 
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
03 Sep 2012 09:23 PM
When locking first person for you FPS(First Person Shooter) you need a LocalScript placed in PlayerGui or either Backpack. The code it is quite simple, too.

First, you want to start off with getting the Player's camera:

game.Workspace -- always in Workspace
.CurrentCamera -- the name of the Camera
game.Workspace.CurrentCamera -- putting it all together
.CameraMode = -- getting ready to declare the camera's mode
0 or 1 -- 0-Classic 1--LockFirstPerson
game.Workspace.CurrentCamera.CameraMode = 0 -- Classic
game.Workspace.CurrentCamera.CameraMode = 1 -- LockFirstPerson
---------------------------------------------------------------------------------------------
Before I remember a glitch that you had to put:
game.Workspace.CurrentCamera.CameraMode = 0
--THEN--
game.Workspace.CurrentCamera.CameraMode = 1
--For reasons I do NOT know, I do NOT know if this is still an issue--
You can also do this to declare it:
game.Workspace.CurrentCamera.CameraMode = "Classic" -- 0
game.Workspace.CurrentCamera.CameraMode = "LockFirstPerson" -- 1

Sources:
http://wiki.roblox.com/index.php/CameraMode_(Enum)
http://wiki.roblox.com/index.php/CameraMode_(Property)

Please give me feedback on how this small tutorial was.

"Is there an Omega Power script out there that can be used in, oh I don't know, Script Builder?" - Noob
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
03 Sep 2012 09:26 PM
That's the only glitch I know sorry, but I don't know if it is still an issue. If not please tell me, so I can let the people know.

~http://www.roblox.com/Forum/ShowPost.aspx?PostID=77422811~ To answer your FPS questions!
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
03 Sep 2012 09:31 PM
Very detailed, very understandable. Great!
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
03 Sep 2012 09:33 PM
Thank you, Cody. Your reply is appriecated.

~http://www.roblox.com/Forum/ShowPost.aspx?PostID=77422811~ To answer your FPS questions!
Report Abuse
CokeCody is not online. CokeCody
Joined: 31 Mar 2010
Total Posts: 394
03 Sep 2012 11:12 PM
Outstaning!
Report Abuse
CokeCody is not online. CokeCody
Joined: 31 Mar 2010
Total Posts: 394
03 Sep 2012 11:16 PM
qq *Oustanding!
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
03 Sep 2012 11:19 PM
or in a normal script in Workspace:

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
repeat wait() until player.PlayerGui and player
player.CameraMode = "LockFirstPerson"
end)

~Don't get mad as to what I said, get mad at me as a person
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
03 Sep 2012 11:21 PM
Enum ~= String
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
04 Sep 2012 04:10 PM
death, as far as I know you can't access the Player's camera without a LocalScript.

~http://www.roblox.com/Forum/ShowPost.aspx?PostID=77422811~ To answer your FPS questions!
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
04 Sep 2012 05:19 PM
Keep rating!

~http://www.roblox.com/Forum/ShowPost.aspx?PostID=77422811~ To answer your FPS questions!
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
04 Sep 2012 05:42 PM
I've done it. When they enter, it locks them into first person.

~Don't get mad as to what I said, get mad at me as a person
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
04 Sep 2012 06:32 PM
Cool! Come on guys, rate!

~http://www.roblox.com/Forum/ShowPost.aspx?PostID=77422811~ To answer your FPS questions!
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
04 Sep 2012 06:36 PM
Jesus, what idiot F5ed?!

~http://www.roblox.com/Forum/ShowPost.aspx?PostID=77422811~ To answer your FPS questions!
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
04 Sep 2012 06:41 PM
Oh lol, I thought it really had that many views at first.
Report Abuse
sup190 is not online. sup190
Joined: 31 Jan 2011
Total Posts: 2026
04 Sep 2012 06:42 PM
Do you answer FPS questions such as - Help fix an auto equip script?
Report Abuse
ThrashSurfFlapjack is not online. ThrashSurfFlapjack
Joined: 20 Feb 2012
Total Posts: 164
06 Sep 2012 02:06 PM
Th --Beginning of the word.
This --This is the beginning of the sentence.
This is --Middle of the sentence.
This is awe --Almost there!
This is awesome! --Done.
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
06 Sep 2012 03:57 PM
Thrash, we know how to spell, I guess you needed a refresher, that's okay we are not perfect.

~http://www.roblox.com/Forum/ShowPost.aspx?PostID=77422811~ To answer your FPS questions!
Report Abuse
ThrashSurfFlapjack is not online. ThrashSurfFlapjack
Joined: 20 Feb 2012
Total Posts: 164
06 Sep 2012 04:00 PM
That's not what i'm saying. It's doing what you did on this thread.
And basically i'm telling you this thread is awesome!
Report Abuse
Candymaniac is not online. Candymaniac
Joined: 08 Oct 2009
Total Posts: 8985
06 Sep 2012 04:15 PM
Isn't it from the player property?

Player.CameraMode = "LockFirstPerson"

?

I always use that and works haha.

☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
06 Sep 2012 08:09 PM
Oh sorry, Thrash, I thought you were mocking me, :3.

~http://www.roblox.com/Forum/ShowPost.aspx?PostID=77422811~ To answer your FPS questions!
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
06 Sep 2012 08:10 PM
Can, I never said it didn't..?

~http://www.roblox.com/Forum/ShowPost.aspx?PostID=77422811~ To answer your FPS questions!
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