Before you say anything, I have looked at other posts and tried to use them. But It doesnt work exactly how I would like it. Im using the humanoid state method and it works sometimes but doesnt always detect it exactly. Is there any other way I could do this? Here is my script if you wanted to see that. I’m making a pogo stick.
local Tool = script.Parent
local Power = 20
local Default = 8.5
local userinputservice = game:GetService(“UserInputService”)Tool.Equipped:Connect(function()
local Character = Tool.Parent
local humanoid = Character.Humanoid
Character.Humanoid.JumpHeight = Power
userinputservice.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Space then
if humanoid:GetState() == Enum.HumanoidStateType.Freefall then
elselocal particle = Tool.Handle.ParticleAttachment.ParticleEmitter particle:Emit() end end end)
end)
Tool.Unequipped:Connect(function()
local Character = Tool.Parent.Parent.Character
Character.Humanoid.JumpHeight = Default
end)