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

[SOLVED] Why does my character still fall over after I disable the FallingDown huamnoid state?

Asked by
LawlR 182
5 years ago
Edited 5 years ago

I disabled it in two scripts just to make sure it disables, but characters still fall over and it takes a second or two for them to get back up. Here is a Gyazo of a character falling: https://gyazo.com/853d501183f3a4fa796086e1d7d1fed9 It happens after I equip a tool for the first time. I even made it so that when the tool gets equipped, the humanoid's state changes to GettingUp, but that made no difference.

The handle of the tool has a script that makes it spin, but that gets deleted right when the player touches the handle, and even if that was making the character fall, it shouldn't since the state is disabled.

Here is the bit that removes the spin script and un-anchores the handle:

--In a server script
tool.CollectedEvent.OnServerEvent:Connect(function()
    tool.Collected.Value = true
    if tool.Handle:FindFirstChild("Script") then tool.Handle.Script:Destroy() end
    tool.Handle.Anchored = false
    wait(.3)
    if tool.Parent:FindFirstChild("Humanoid") then
    tool.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
    end
end)
--The event gets called when the tool is equipped.
0
Events don't get called, they get fired. It's functions that get called. And do indent your code thanks. User#19524 175 — 5y
0
That's what I meant. LawlR 182 — 5y
0
Because you simply changed the state. It will not force the state to be at said state. Try SetStateEnabled, and the second argument to that method is a boolean. Set it to true. User#19524 175 — 5y
0
So tool.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true) User#19524 175 — 5y
View all comments (5 more)
0
Yeah I did that in a StarterCharacterScript. LawlR 182 — 5y
0
Anyway I realised I was just disabling the state in a server script. My bad.. LawlR 182 — 5y
0
Is the problem fixed? User#19524 175 — 5y
0
Yes. LawlR 182 — 5y
0
In that case update the title so it contains "[SOLVED]". This will mark the question as answered and let others know the problem has been resolved. User#19524 175 — 5y

Answer this question