Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Need help with values [?]

my rocket boot script used to work its just when I tried to make the function only work when jumping is true, It doesn't. Help?

script.Parent.Parent.Humanoid.Changed:connect(function(Change)
	if Change == 'Jump' and Change.Value == true then
    script.Parent.Fire.Transparency = 0
    wait(0.2)
    script.Parent.Fire.Transparency = 1
	end
end)

what am I doing wrong

1 answer

✓ Accepted answer

Try using this for line two:

if Change == 'Jump' and script.Parent.Parent.Humanoid.Jump == true then

This instead accesses the Humanoid and looks at the Jump property and checks if it is true. If that doesn't work, the issue could be that the script checks the value before the player even begins jumping (scripts run incredibly fast). To fix this, use this modification.

script.Parent.Parent.Humanoid.Changed:connect(function(Change)
    if Change == 'Jump then
	wait() 
	if script.Parent.Parent.Humanoid.Jump == true then
    script.Parent.Fire.Transparency = 0
    wait(0.2)
    script.Parent.Fire.Transparency = 1
    end
end
end)

Just by adding the wait() it gives the game enough time to register the jump and change the value in the humanoid before we check it.

This discussion is preserved as it was. New answers, comments, and votes are closed.