Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

ROBLOX's Problem Or Is It My Problem?

Here's the script:

local plr = game.Players.LocalPlayer
local cam = game.Workspace.CurrentCamera
local chr = nil

chr = character
plr.CameraMode = 1

while false do
wait ()
cam.CameraType = 0
cam.CoordinateFrame = CFrame.new (200,10,0)
cam.Focus = CFrame.new (200,7,500)
cam.FieldOfView = 20
end

This script is suppose to lock you into first person all the time. When I tested this out on ROBLOX Studio it worked. But when I enter my place normally, it doesn't work for some weird reason. Is this ROBLOX's problem or my problem? If it's my problem, then can you please tell me what am I doing wrong?

1 comment

0

Yes, it is in a local script; and the local script is in the StarterGui.

2 answers

For some kind of stupid reason which I still don't understand, those issues can be fixed by putting a wait() on top of your script.

Also, are you running this in a LocalScript? (In Play Solo everything is used as LocalScript so using this as Server script would not mess up anything!)

wait()
local plr = game.Players.LocalPlayer
local cam = game.Workspace.CurrentCamera
local chr = nil

chr = character
plr.CameraMode = 1

while false do
wait ()
cam.CameraType = 0
cam.CoordinateFrame = CFrame.new (200,10,0)
cam.Focus = CFrame.new (200,7,500)
cam.FieldOfView = 20
end

2 comments

0

Why I never even thought of that! I'm so happy now; thanks for explaining to me!

0

It's not really a straightforward thing to do and it also isn't very logical ;) Just keep this in mind, as it appears to fix a lot of bugs. If a script works in Test Server (with a Test Player) and not online, try adding a wait() - this fixes the problem in most cases!

Is it a local script?

4 comments

0

The next time, post this as comment ;)

0

Yes, it is in a local script; and the local script is in the StarterGui.

0

Sorry the site wasn't letting me...

0

You need 10+ rep to comment on things other then yours.

This discussion is preserved as it was. New answers, comments, and votes are closed.