Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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?

6 comments

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

0

No. newVal will be the value for Value instances such as BoolValue

0

Tried that too, didn't help. I also tried to print the value as well, but the output window is blank

0

I also tried putting "script.Parent:WaitForChild("Update")" to replace the 2nd line but that didn't help either

0

try printing Update.Value.

0

Tried doing that, but it doesn't print out anything

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.