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: LockFirstPerson troubles

Previous Thread :: Next Thread 
SilverNinja14 is not online. SilverNinja14
Joined: 16 Mar 2010
Total Posts: 1038
23 Jun 2012 12:01 AM
I have this context in a LocalScript in StarterGui and it suceeds the first time, but not after the player respawns. Can anyone help me out?

while true do
wait(0.1)
game:GetService("Players").LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
end
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
23 Jun 2012 12:04 AM
Output? It may be when that part of a second lapses where there's no camera to work with it errors.
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
23 Jun 2012 12:05 AM
The setting for cameraMode, if I remember correctly, shouldn't change when you respawn. I'm not sure of this either, but changing it to classic then to firstperson seemed to 100% garentee a sucessfull FPS lock without any camera glitches.

game.Players.LocalPlayer.CameraMode.Changed:Connect(function()
game.Players.LocalPlayer.CameraMode = "Classic"
game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
end)
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
23 Jun 2012 12:06 AM
^ True
Report Abuse
SilverNinja14 is not online. SilverNinja14
Joined: 16 Mar 2010
Total Posts: 1038
23 Jun 2012 12:11 AM
@WhoBloxedWho
Didn't work e.e

@Ninjaknight101
I forgot to mention, it still works in Play Solo.
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
23 Jun 2012 12:14 AM
Maybe:

game.Players.LocalPlayer.Changed:Connect(function(property)
if property.Name == "CameraMode" then -- I think....
game.Players.LocalPlayer.CameraMode = "Classic"
game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
end
end)
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
23 Jun 2012 12:18 AM
Wow, I'm an idiot, I capitalized the "c" in connect <.> Give me a break, I'm tired:


wait(.5)
game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
game.Players.LocalPlayer.Changed:connect(function(property)
if property.Name == "CameraMode" then -- I think....
game.Players.LocalPlayer.CameraMode = "Classic"
game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
end
end)
Report Abuse
SilverNinja14 is not online. SilverNinja14
Joined: 16 Mar 2010
Total Posts: 1038
23 Jun 2012 12:18 AM
Nope. :\
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
23 Jun 2012 12:19 AM
Did ya try the new script?
Report Abuse
SilverNinja14 is not online. SilverNinja14
Joined: 16 Mar 2010
Total Posts: 1038
23 Jun 2012 12:21 AM
Yep. Usually I don't have to resort to the forums. But this is obviously not just a difficulty for me.
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
23 Jun 2012 12:22 AM
The fps stays, so just do this

wait(.5)
game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
Report Abuse
SilverNinja14 is not online. SilverNinja14
Joined: 16 Mar 2010
Total Posts: 1038
23 Jun 2012 12:23 AM
That was what I had at first but ill try.
Report Abuse
SilverNinja14 is not online. SilverNinja14
Joined: 16 Mar 2010
Total Posts: 1038
23 Jun 2012 12:27 AM
Nope
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
23 Jun 2012 12:30 AM
It works fine for me, idk whats wrong. It's just 2 lines of code.
Report Abuse
SilverNinja14 is not online. SilverNinja14
Joined: 16 Mar 2010
Total Posts: 1038
23 Jun 2012 12:31 AM
e.e
Report Abuse
SilverNinja14 is not online. SilverNinja14
Joined: 16 Mar 2010
Total Posts: 1038
23 Jun 2012 12:32 AM
Does it still work when you reset?
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
23 Jun 2012 12:34 AM
Yus
Report Abuse
SilverNinja14 is not online. SilverNinja14
Joined: 16 Mar 2010
Total Posts: 1038
23 Jun 2012 12:36 AM
Well not for me. e.e
Report Abuse
SilverNinja14 is not online. SilverNinja14
Joined: 16 Mar 2010
Total Posts: 1038
23 Jun 2012 12:37 AM
Where do you have the script located? StarterGui?
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
23 Jun 2012 12:38 AM
Anywhere, Workspace
Report Abuse
SilverNinja14 is not online. SilverNinja14
Joined: 16 Mar 2010
Total Posts: 1038
23 Jun 2012 12:39 AM
You have a local script in workspace? Wut?
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
23 Jun 2012 12:43 AM
Not a local script, a regular script, in workspace
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
23 Jun 2012 12:43 AM
Agh, thats why it didn't work
Report Abuse
SilverNinja14 is not online. SilverNinja14
Joined: 16 Mar 2010
Total Posts: 1038
23 Jun 2012 12:43 AM
If its a regular script then where does it get "LocalPlayer" from? e.e
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
23 Jun 2012 12:44 AM
LocalPlayer can be accessed out of local script -.º *yawn* it's getting late
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