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

How to properly use boolvalue.changed?

Held is a boolvalue object

object.Held.Changed:Connect(function()
	print("changed")
	if object.Held.Value then
		print(object.Held.Value)
		object.Trail.Enabled = false
	elseif object.Held.Value == false then
		print(object.Held.Value)
		object.Trail.Enabled = true
	end
end)

nothing prints and nothing works

1 answer

Use :GetPropertyChangedSignal("Value")

object.Held:GetPropertyChangedSignal("Value"):Connect(function()
    print("changed")
    if object.Held.Value then
        print(object.Held.Value)
        object.Trail.Enabled = false
    elseif object.Held.Value == false then
        print(object.Held.Value)
        object.Trail.Enabled = true
    end
end)

3 comments

0

Still nothing prints, but held.value does change

0

" Held is not a valid member of Part"

0

Change it to a lowercase h because I think Held is a property of the part

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