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: Forced first person (LocalScript) not working online.

Previous Thread :: Next Thread 
maplestick is not online. maplestick
Joined: 29 Jul 2012
Total Posts: 542
17 Sep 2014 01:29 PM
I got this from the ROBLOX wiki.

game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson

I put it in the StarterGui as LocalScript, it works offline, but not online. The game is single-player, so i didn't think it would have any issues. Can someone inform me what's wrong?
Report Abuse
maplestick is not online. maplestick
Joined: 29 Jul 2012
Total Posts: 542
17 Sep 2014 01:35 PM
I bet people are going to see my post and be like

"Yeah, you're hopeless, mate."
Report Abuse
Bobobob12 is not online. Bobobob12
Joined: 23 Jan 2008
Total Posts: 5350
17 Sep 2014 01:37 PM
try adding

game:GetService('Players').LocalPlayer.CharacterAdded:wait()

before it

in solo everything loads at once so it works, but the script may run without the character and do nothing in online
Report Abuse
maplestick is not online. maplestick
Joined: 29 Jul 2012
Total Posts: 542
17 Sep 2014 01:39 PM
It didn't do the trick. Perhaps it needs to detect if there are any players first?
Report Abuse
Bobobob12 is not online. Bobobob12
Joined: 23 Jan 2008
Total Posts: 5350
17 Sep 2014 01:43 PM
nah, it only runs when it's in the player

you could add a wait(10) for temporary testing and see if that works, if it does then we know the problem
Report Abuse
maplestick is not online. maplestick
Joined: 29 Jul 2012
Total Posts: 542
17 Sep 2014 01:48 PM
Don't hate me for this.

I tried to put a LocalScript in the players tab. I think it divided by 0. In other words, it crashed instantly.
Report Abuse
maplestick is not online. maplestick
Joined: 29 Jul 2012
Total Posts: 542
17 Sep 2014 02:05 PM
Alright, i got my stuff back.

I've been googling all topics for first perosn camera's. Looks like a lot of people are having trouble with that. I tried a few scripts that were suggested on other forums, but they all don't work online.

I'm very glad the people that post on my threads are very helpful. I can imagine the pain when someone keeps asking for help. But this is the absolute LAST thing i need to know! I promise! So please, if you have a spare code, don't mind sharing it with me.
Report Abuse
Fatalizer is not online. Fatalizer
Joined: 28 Aug 2011
Total Posts: 1520
17 Sep 2014 02:19 PM
Put a local script into StarterGui. Or have you tried already ?



~ I don't rekt kids, I eat them ~
Report Abuse
maplestick is not online. maplestick
Joined: 29 Jul 2012
Total Posts: 542
17 Sep 2014 02:29 PM
I tried EVERYTHING!
Report Abuse
Fatalizer is not online. Fatalizer
Joined: 28 Aug 2011
Total Posts: 1520
17 Sep 2014 02:31 PM
Tried enum ?



~ I don't rekt kids, I eat them ~
Report Abuse
oscar9999991 is not online. oscar9999991
Joined: 15 Nov 2009
Total Posts: 11373
17 Sep 2014 02:34 PM
Do this, put a local script in starter gui and put this code in,

wait(2)
game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
17 Sep 2014 02:38 PM
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.Classic
wait(2)
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson

Report Abuse
Fatalizer is not online. Fatalizer
Joined: 28 Aug 2011
Total Posts: 1520
17 Sep 2014 02:39 PM
Put this inside a local script into the StarterGui:

game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson



~ I don't rekt kids, I eat them ~
Report Abuse
iC7G is not online. iC7G
Joined: 30 Jan 2013
Total Posts: 5377
17 Sep 2014 02:39 PM
After a bit of testing, CharacterAdded didn't work but wait(10) did.

VULNERITE YA im vulnerite AKA keith and im banned
Report Abuse
Fatalizer is not online. Fatalizer
Joined: 28 Aug 2011
Total Posts: 1520
17 Sep 2014 02:42 PM
Mine works perfectly.



~ I don't rekt kids, I eat them ~
Report Abuse
iC7G is not online. iC7G
Joined: 30 Jan 2013
Total Posts: 5377
17 Sep 2014 02:43 PM
No it doesn't, try it here:
http://www.roblox.com/iC7Gs-Place-Number-7-place?id=178252122

code:
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson

VULNERITE YA im vulnerite AKA keith and im banned
Report Abuse
oscar9999991 is not online. oscar9999991
Joined: 15 Nov 2009
Total Posts: 11373
17 Sep 2014 02:44 PM
did you try mine? cause it works for me
Report Abuse
iC7G is not online. iC7G
Joined: 30 Jan 2013
Total Posts: 5377
17 Sep 2014 02:46 PM
Yeah, uploaded it here:
http://www.roblox.com/iC7Gs-Place-Number-7-place?id=178252122

It appears you need to wait at least 2 seconds or it won't work or error.

VULNERITE YA im vulnerite AKA keith and im banned
Report Abuse
maplestick is not online. maplestick
Joined: 29 Jul 2012
Total Posts: 542
17 Sep 2014 03:58 PM
Thanks for the replies!

Sadly, it's almost midnight here. I'm going to bed. I'll try the scripts out tomorrow.

Again, thanks for all your support.
Report Abuse
wonuf is not online. wonuf
Joined: 28 May 2013
Total Posts: 133
17 Sep 2014 04:07 PM
http://www.roblox.com/Lock-First-Person-StarterPack-item?id=178265653

It's pretty simple, just put this in Starter Pack, also read it so you can understand how I did it.

[Also, something that may help you: When in studio go to 'Help' and then 'Object Browser', that's basically every object in ROBLOX and everything you can do to it]
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