I am creating a slow effect in my game and want it remove itself after 5 seconds.
I created a script inside a mob to try and track when the WalkSpeed changes, and to change it back.
Summary
local mob = script.Parent
local baseSpeed = mob:WaitForChild("BaseSpeed").Value
mob.Humanoid.WalkSpeed.Changed:Connect(function()
wait(5)
mob.Humanoid.WalkSpeed = baseSpeed
end)
This is the only way that I know for tracking a Change, but I get the error:
attempt to index number with 'Changed'