So, i’m currently learning some new stuff about roblox scripting and i’ve got to a topic where it talks about “Humanoid State Type” and decided to experiment myself. At first i was trying to make a print statement when the humanoid is currently in that state type, i wanted to apply this for swimming, but i couldn’t find the keyword for it anywhere.
Anyway here’s my code:
local humanoid = game.Workspace:WaitForChild("Qapandt").Humanoid
humanoid.StateChanged:Connect(function()
if humanoid.WhatsTheKeyword == Enum.HumanoidStateType.Swimming then --here
print("Player is swimming")
end
end)