Stills jumping when is disabled (Tool, Local Script)

Code:

local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local loadidleanim = hum:LoadAnimation(idleAnim)
local loadliftanim = hum:LoadAnimation(liftAnim)

tool.Equipped:Connect(function()
	loadidleanim:Play()
	hum.JumpPower = 0
	hum.WalkSpeed = false
end)
tool.Unequipped:Connect(function()
	loadidleanim:Stop()
	loadliftanim:Stop()
	hum.JumpPower = true
	hum.WalkSpeed = true
end)
tool.Activated:Connect(function()
	loadliftanim:Play()
	hum.JumpPower = 0
	hum.WalkSpeed = false
end)

pls respond fast!

JumpPower and WalkSpeed are properties that only accept integer or number values and not boolean values (like true or false)

You’d have to set them to a number value like 16 or set it to something like 0 if you don’t want the player to be able to move or jump

I did that but stills Jumping!

local tool = script.Parent
local idleAnim = tool:WaitForChild("IdleAnimation")
local liftAnim = tool:WaitForChild("LiftAnimation")
local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local loadidleanim = hum:LoadAnimation(idleAnim)
local loadliftanim = hum:LoadAnimation(liftAnim)

tool.Equipped:Connect(function()
	loadidleanim:Play()
	hum.JumpPower = 0
	hum.WalkSpeed = 0
end)
tool.Unequipped:Connect(function()
	loadidleanim:Stop()
	loadliftanim:Stop()
	hum.JumpPower = 7.2
	hum.WalkSpeed = 16
end)
tool.Activated:Connect(function()
	loadliftanim:Play()
	hum.JumpPower = 0
	hum.WalkSpeed = 0
end)

Alright try using SetStateEnabled like this:

hum:SetStateEnabled(Enum.HumanoidStateType.Physics, true)

And when you need it to be enabled again just do:

hum:SetStateEnabled(Enum.HumanoidStateType.Physics, false)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.