|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 23 Jun 2012 12:19 AM |
| Did ya try the new script? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 23 Jun 2012 12:22 AM |
The fps stays, so just do this
wait(.5) game.Players.LocalPlayer.CameraMode = "LockFirstPerson" |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2012 12:23 AM |
| That was what I had at first but ill try. |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Jun 2012 12:30 AM |
| It works fine for me, idk whats wrong. It's just 2 lines of code. |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Jun 2012 12:32 AM |
| Does it still work when you reset? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 23 Jun 2012 12:37 AM |
| Where do you have the script located? StarterGui? |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Jun 2012 12:39 AM |
| You have a local script in workspace? Wut? |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2012 12:43 AM |
| Not a local script, a regular script, in workspace |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2012 12:43 AM |
| Agh, thats why it didn't work |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2012 12:43 AM |
| If its a regular script then where does it get "LocalPlayer" from? e.e |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2012 12:44 AM |
| LocalPlayer can be accessed out of local script -.º *yawn* it's getting late |
|
|
| Report Abuse |
|
|