So here is my script. ServerScript located into the NPC. The NPC takes a nose dive into water as he should based on standard roblox physics, I'm looking for him to float across the top, or at least not nose dive. I would create an animation if needed, I just was hoping to simply insert this script into future NPCs to avoid animating tons of future various NPCs.
I feel like this should be simple, but i've messed around with but didn't manage to get it to work.
Thank you!
function swim()
if script.Parent.Humanoid:GetState()==Enum.HumanoidStateType.Swimming then
script.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)
end
end
script.Parent.Humanoid.StateChanged:Connect(swim)

1 comment
I have used a body velocity to make it float on the water. but if someone could please help me execute this script it will stop the nose dive. Thanks!