Hey! I need some help here, so. I made a fov changing script with datastore to save the FOV the user set, the datastore and everything else works, but the script that actually changes the FOV. Please help, thanks!
Here is the script that makes the values…
Script Name: data
-- // Copyright 2022, UnspeakableGames112, All rights reserved.
game.Players.PlayerAdded:Connect(function(player)
-- fov
local fold = Instance.new("Folder")
fold.Parent = player
fold.Name = "Data"
local fov = Instance.new("NumberValue")
fov.Parent = fold
fov.Name = "fov"
end)
Here is where they are located:
The script that sets the FOV of the camera:
Script Name: Localscript
-- // Copyright 2022, UnspeakableGames112, All rights reserved.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local data = player:WaitForChild("Data")
local val = data:WaitForChild("fov")
workspace.CurrentCamera.FieldOfView = val.Value
print("value")
end)
end)