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

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

Asked by 5 years ago

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

Log in to vote
0
Answered by 5 years ago

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

0
BoolValue.Changed will work if the Value of the bool value has changed so you dont need that Lazarix9 245 — 5y
Ad

Answer this question