How To Change A LocalScript's Value or Make A LocalScript with Custom String with Function?

Hello!

I’m basically trying to make a script that changes the FOV to a custom value.

I was wondering, is there a way to make a module function or just a function that I could use in a Server Script that changes the FOV value?

Or maybe there’s another method, just wondering.

The camera is meant to be manipulated via a localscript. not a server script. Could you explain why you want to use a server script for this?

1 Like

Yes, I’m basically working on a “UTG” project, scripts like those that I could require and use in other games. I’m pretty far and almost done, and everything’s done in a Server Script.

Are you trying to manipulate it by a UI or will you just need a function, because if you just need a functions just use a module script inside of ReplicatedStorage and make a function that can be called from both the Server and Client.

As in your previous post, you asked about it being manipulated on the Client, so you can have your Event hooked up on the client, make it receive a parameter for the new FOV then call on the function inside of your module with that same parameter.

1 Like

Just a function, I’ll try to explain it in detail this time, it’ll make it easier for you guys.

I’m basically trying to make the FOV change on Playbackloudness, which yes, I did find a way on how to make the ServerScript read Playbackloudness and it works 100% without any issues, and yes, I also know how I would do this via a LocalScript. It would look something like this…

local Audio = PathHere
local RunService = game:GetService("RunService")

RunService.RenderStepped:Connect(function()
      local PlaybackLoudnessFormule = Audio.PlaybackLoudness / 40 -- 40 Can be changed, 40 is the sensitivity.
      workspace.Camera.FOV = 70 + PlaybackLoudnessFormule
end

I’m basically trying to do this^^ in either a ServerScript for all players in game, but since it’s not possible I wanna know what other methods to use, preferably a module method.