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

Help with .Changed?

Asked by 10 years ago

What this script is suppose to do is when the textbox.text changes, this script will change the value of the value that's linked to the textbox and that value will be the number that was set in the text box.

However the value doesn't change when you input a new number in the textbox's.

Players.IntellectualBEing.PlayerGui.MouseSensitivity:45: attempt to perform arithmetic on field 'MouseSensitivity' (a userdata value)

local MouseSettings = script.Parent.Parent:WaitForChild("Menu").Holder.Pages.Settings.MSTextBox
local MouseOSettings = script.Parent.Parent:WaitForChild("Menu").Holder.Pages.Settings.MSOTextBox


MouseSettings.Changed:connect(function(A)
 _G.MouseSensitivity.Value = tonumber(A)
end)

MouseOSettings.Changed:connect(function(B)
 _G.MouseSensitivityOffset.Value = tonumber(B)
end)
1
The error you quote is from a different script for a different reason than not storing correct. Why are you using `_G` to store a `Value` object? Just store the number you want in _G, not an object with the value. That adds nothing. BlueTaslem 18071 — 10y
0
Okay. IntellectualBeing 430 — 10y

Answer this question