local tool = script.Parent
tool.Equipped:Connect(function()
local humanoid = tool.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.JumpHeight = 15
end
end)
tool.Unequipped:Connect(function()
print("Unequippded")
local humanoid = tool.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.JumpHeight = 7.2
end
end)
#Why when I unequip, the player's jump height remains the same?
1 messages · Page 1 of 1 (latest)
do you use jump height or jumppower
Jump height
can you make an else check and do a print message inside the else check?
like do else for both if checks
did u fix it
** You are now Level 2! **
Oh ok
My else statement isnt firing so I guess its supposed to work but just doesnt?
can u do it for the equipped one too?
local tool = script.Parent
tool.Equipped:Connect(function()
local humanoid = tool.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.JumpHeight = 15
else
print("Equipped")
end
end)
tool.Unequipped:Connect(function()
local humanoid = tool.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.JumpHeight = 7.2
else
print("Unequipped")
end
end)
does it work
yeah none of my else statements are firing
does ur tool have a handle?
Yes
can u run the game, find ur character's humanoid, click on the humanoid, and equip and unequip the tool?
Yes
Its added and removed from the humanoid everytime i equip and unequip
just to check this is disabled right?
Yes
is the script ur using a localscript or a serverscript
i dont see why it's not working for you as it works for me
can isee the handle part
@fading marsh
can you use this?
local tool = script.Parent
local humanoid
tool.Equipped:Connect(function()
humanoid = tool.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.JumpHeight = 15
end
end)
tool.Unequipped:Connect(function()
if humanoid then
humanoid.JumpHeight = 7.2
end
end)
you cant find the humanoid at the unequipped function
so i made a nil humanoid variable outside the functions
and then i did humanoid = tool.Parent:FindFirstChild("Humanoid") inside the .equipped function, turning the variable as a humanoid variable
Oh how did you know
well because the tool disappears when u unequip it
oh i thought thats what happens when stuff unequip
btw i was wondering if you use the console output window on roblox studio
cause if u dont use it
it'll help u fix most of ur errors
the reason it didn't throw an error is cause u added an if check to see if the humanoid exists or not
Oh i use it
OH
yeah that's why
** You are now Level 3! **
thanks so much for the help man
np
no problem
i referenced the humanoid as a parent when the tool wasnt even in it
dang
i would've never know
well now you know