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

Why isn't the Changed event firing in this script?

Okay, so I wanted to make a script that, whenever "Trip" (A bool value) becomes true, the script trips the player and makes bool false again. For some reason though, the .Changed event isn't firing.

local character = script.Parent
local humanoid = character.Humanoid
local tripbool = Instance.new("BoolValue")
tripbool.Name = "Trip"
tripbool.Parent = character

local function tripCharacter()
	humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
	tripbool.Value = false
end

tripbool.Changed:Connect(tripCharacter)

I've tried putting prints in the script, and it looks like the function isn't firing. Is there something I'm doing wrong?

1 answer

Maybe you should use :GetPropertyChangedSignal("Value") instead of .Changed

1 comment

0

BoolValue.Changed will work if the Value of the bool value has changed so you dont need that

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