(post no longer available)

This post is old and no longer being updated.

Are there any other parts of the script that could be possibly interfering?

I think my old reply was misinterpreting the issue. I now assume the issue is that the print isn’t printing like you want it to, not that the sounds are not playing. If that’s the case, maybe UserInputService.JumpRequest is what you’re after for jumping? I assume then the issue would be firing too much.

Also, the use of StateChanged from the humanoid is working in my game like this:


humanoid.StateChanged:Connect(function(oldState, newState) 
	if newState == Enum.HumanoidStateType.Landed then
		print("Landed!")
	elseif newState == Enum.HumanoidStateType.Jumping then
        print("Jumping!")
    end
end)

Old Reply:

Roblox adds a ‘Jumping’ sound effect to the player’s HumanoidRootPart (Character) when that player joins a game. You should be able to simply change the SoundID of that, but only on runtime in a script. (Not in studio, annoyingly.)

I don’t think so. From what my script contains, I don’t believe there should be any conflicts between my other functions and this one.

Yes, sometimes the function prints either way too much are not at all. I have tried UserInputService.JumpRequest just like you stated as well. I have not tried your method, however. I will test it and give an update.

1 Like

For some reason it is still inconsistent with how it works.
Sometimes it prints only “Jumping.” or only “Not jumping.” other times it does not print at all or it prints too much. Still have no idea what the issue could be.

1 Like

Are you using a custom character/StarterCharacter? (Humanoid HipHeight might be affecting things or something else. :person_shrugging: )

I am using a StarterCharacter. The character itself doesn’t have any outstanding differences of a regular character though. It is just an R6 Rig with customized body colors and a special head mesh attached to it. How might a custom character cause problems?

1 Like

That doesn’t sound like that would cause an issue to me. If the HipHeight is too low or too high, I assume that impacts what counts as “landing”.


Image showing HipHeight property for a custom character of mine.

Other than that, I’m not sure what the issue could be. Printing based on StateChanged works fine for my custom character.

Are you using a LocalScript or a ServerScript for StateChanged? I wonder if that is somehow the problem.

1 Like

I am using a custom Animate Module Script that runs locally, parented to StarterCharacterScripts.

image

Weird. When I try this locally, no issue. On the server, doesn’t work.

1 Like

Maybe try moving the function to a direct local script

What is a direct LocalScript and where should I place it in my game?

Is the script in a server script or a local script? If it is in a server script or a module try moving it directly to a local script.

It is a server script, but from what I understand, you cannot play sounds from a local script that are heard by all players. I’m just using print() statements as placeholders to ensure that the function runs consistently.