function onButtonClicked() game.StarterGui.Camera.settings.display.res = 30 end script.Parent.MouseButton1Click:connect(onButtonClicked)
I'm editing this script so it changes the value of the resolution of something that I'm making. On the display.res part, it thinks that res is a property of display. How do I make this not happen?
What I'm getting in the output
23:26:06.085 - res is not a valid member of IntValue
From a confused beginner scripter
function onButtonClicked(res) game.StarterGui.Camera.settings.display.res = 30 end script.Parent.MouseButton1Click:connect(onButtonClicked)
try this and is there a full script of this?
.Value
after res
. Also, you’re using StarterGui
instead of PlayerGui
. I will fix your code. Do you not believe in variables? This is what causes people to access objects script.Parent
style.local plr = game:GetService("Players").LocalPlayer function onButtonClick() -- no parameters. a previous answer had one, that would error. local cam = plr:WaitForChild("PlayerGui").Camera cam.Settings.Display.Res.Value = 30 -- here was your problem end script.Parent.MouseButton1Click:Connect(onButtonClick) -- Connect, not connect
:Connect()
, as ROBLOX has plans to remove :connect()
.