Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ROBLOX's Problem Or Is It My Problem?

Asked by 10 years ago

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?

0
Yes, it is in a local script; and the local script is in the StarterGui. DesignerDavid 0 — 10y

2 answers

Log in to vote
0
Answered by
jobro13 980 Moderation Voter
10 years ago

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

0
Why I never even thought of that! I'm so happy now; thanks for explaining to me! DesignerDavid 0 — 10y
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! jobro13 980 — 10y
Ad
Log in to vote
-1
Answered by 10 years ago

Is it a local script?

0
The next time, post this as comment ;) jobro13 980 — 10y
0
Yes, it is in a local script; and the local script is in the StarterGui. DesignerDavid 0 — 10y
0
Sorry the site wasn't letting me... VariadicFunction 335 — 10y
0
You need 10+ rep to comment on things other then yours. ultrabug 306 — 10y

Answer this question