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

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

Asked by 7 years ago

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

0
FE enabled? AstrealDev 728 — 7y
0
LocalScript? Goulstem 8144 — 7y
0
Nope ragingskull182 67 — 7y
0
I tried using a localscript and it didnt work ;-; ragingskull182 67 — 7y

1 answer

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
7 years ago

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")

Ad

Answer this question