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

Changed won't work on a Local script? Please help! {Works in Studio but not in PlayMode}

Asked by 6 years ago
Edited 6 years ago
local Event = game.ReplicatedStorage.Events:WaitForChild("AptSettingsUpdate") -- Not important 
local Update = script.Parent.Update

Update.Changed:connect(function(newVal) 
    if newVal == true then 
        Event:FireServer()
    end
end)

Update is a boolvalue that changes it's value once I click on a button. Any Idea of why this is happening?

0
I don't think 'newval' is the way you should use it, newval would be the propertie, not the 'new value', change 'newval' on line 5 to Update.Value User#20388 0 — 6y
0
No. newVal will be the value for Value instances such as BoolValue Amiaa16 3227 — 6y
0
Tried that too, didn't help. I also tried to print the value as well, but the output window is blank KhanPython 7 — 6y
0
I also tried putting "script.Parent:WaitForChild("Update")" to replace the 2nd line but that didn't help either KhanPython 7 — 6y
View all comments (2 more)
0
try printing Update.Value. User#21908 42 — 6y
0
Tried doing that, but it doesn't print out anything KhanPython 7 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

When I was having this problem it worked to put script.Parent.Update rather than

Update.Changed:connect(function(newVal)

IDK why that worked. why don't you try and tell me if it worked.

Ad

Answer this question