So this is my first tutorial, so tell me if I am doing anything wrong, but anyway, enjoy!
First, you’re going to want to add a screen GUI and put, a text box, a text label, and a text button, and a IntValue in replicated storage. name it FOV
Change the text in the button to, Press to confirm FOV! , or whatever you want it so say. Change the label to FOV Changer, or whatever you want, and leave the button empty
Then add a local script to the Text button
First, we will want to make a few variables
get the camera
get the text box
get the text button
get the int value
local textBox = script.Parent.Parent.TextBox -- gets the text box
local textBtn = script.Parent -- gets the text button
local FOVVal = game:GetService("ReplicatedStorage").FOV -- gets the FOV int value```
Then we need to detect when the button is pressed!
textBtn.MouseButton1Click:Connect(function()
end)
Now add the FOV’s value = to the textbox value
textBtn.MouseButton1Click:Connect(function()
FOVVal = textBox.Text
end)
And drop a line and make the camera.FieldOfView = to the FOVVal’s value!
textBtn.MouseButton1Click:Connect(function()
FOVVal = textBox.Text
camera.FieldOfView = FOVVal.Value
end)
and there you have it! and FOV changer gui!
local camera = workspace.Camera -- gets the camera
local textBox = script.Parent.Parent.TextBox -- gets the text box
local textBtn = script.Parent -- gets the text button
local FOVVal = game:GetService("ReplicatedStorage").FOV -- gets the FOV int value
textBtn.MouseButton1Click:Connect(function()
FOVVal = textBox.Text
camera.FieldOfView = FOVVal.Value
end)
Hope this helps someone!