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

FOV Manipulator only works in Studio but not in server, could someone help?

So I'm making a FieldOfView manipulator script using the PlaybackLoudness feature. The problem is, it all works in Studio, but none of it works in server. Could someone help me figure out this problem? Thanks!

Script:

local Sound = game.Soundscape.Music


local Part = game.Workspace.CurrentCamera

while true do
    local x = game.Workspace.Light.Value.Value/20 + 70 --This is basically the	 PlaybackLoudness in a NumberValue.
    wait(0.001)
    Part.FieldOfView = x
end

4 comments

0

FE enabled?

0

LocalScript?

0

Nope

0

I tried using a localscript and it didnt work ;-;

1 answer

Camera manipulation code will only work in a live server from a LocalScript. This is because the Server's Camera doesn't render anything and is not replicated, for obvious reasons. You have to edit each Client's camera.

LocalScripts won't run just anywhere. Listed on this page at the top is where you can put a LocalScript and have it run.

Since the Client may not have loaded everything when Scripts are run, you may have to use WaitForChild on various objects, for instance game.Workspace.Light.Value might need to be: game.Workspace:WaitForChild("Light"):WaitForChild("Value")

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