So I tried Many times it works , it sits in game , but i need to make player sit again if jumped and only get up once the health gets to a certain point heres the script to see what changes i need to make
while wait() do
local humanoid = game:GetService("Players").LocalPlayer.Character.Humanoid if humanoid.Health < 10 then -- if thecharacters health is less than ten den he sits humanoid.Sit = true humanoid.JumpPower = 0 humanoid.Speed = 0 elseif humanoid.Health > 10 then -- other wise he stands O.O end end local humanoid = game:GetService("Players").LocalPlayer.Character.Humanoid humanoid.Sit = false humanoid.JumpPower = 50 humanoid.Speed = 16
while wait() do local humanoid = game:GetService("Players").LocalPlayer.Character.Humanoid if humanoid.Health < 10 then humanoid:Sit() humanoid.JumpPower = 0 humanoid.WallSpeed = 0 elseif humanoid.Health > 10 then local humanoid = game:GetService("Players").LocalPlayer.Character.Humanoid humanoid.JumpPower = 50 humanoid.Speed = 16 end end
This should work. Put it in a local script in StarterGui and it should be fine. But the indentation may not be correct as I worked off your code which was not indented.
If this helped please up vote and accept this answer.
All the best,
PrismaticFruits
Maybe you can use the humanoid.StateChanged(oldstate,newstate) event and bind it to that function. You can check if oldstate == Enum.HumanoidStateType.Jumping on the function then.