I don't know how you would detect if state has been interrupted and after a second it would say if it got interrupted.
The script looks like this: local animation = script.Parent.Freefall
local humanoid = script.Parent.Parent.Parent.Humanoid
local character = humanoid.Parent
humanoid.FreeFalling:Connect(function()
wait(1)
if character:FindFirstChild("Rope") == nil then
humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
local ActiveTracks = humanoid:GetPlayingAnimationTracks()
for _,v in pairs(ActiveTracks) do
v:Stop()
end
local load = humanoid:LoadAnimation(animation)
character.Animate.Disabled = true
load:Play()
humanoid.GettingUp:Connect(function()
load:Stop()
character.Animate.Disabled = false
end)
end
end)
If by "interrupted" you mean changed, then you can use the Humanoid.StateChanged
event.
Here's an example of the same:
lua
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
char:FindFirstChild("Humanoid").StateChanged:Connect(function(old, new) -- old state and new state
print("Humanoid went from "..tostring(old).." to "..tostring(new).."!")
-- You can also check the old and new states to make things occur at certain points like falling down
end)
end)
end)
On a sidenote, please remember to use codeblocks when posting scripts as such:
```lua print("Hello World!") ```
lua
print("Hello World!")
Please comment if you have any questions or I have made any mistakes