Hello all !
So, I have a script that plays a sound when you jump and plays a sound when you land.
Unfortunately, the jump sound wont work, but the land sound will, I don’t know why and I am stuck on finding a solution for this.
Here is the script:
local char = script.Parent
local humanoid = char:FindFirstChild("Humanoid")
local spinballmodule = require(game:GetService("ReplicatedStorage").MechanismModule.SpinBallJump)
local jumpSound = char:WaitForChild("sound1")
local landSound = char:WaitForChild("sound2")
humanoid.StateChanged:Connect(function(newstate)
if newstate == Enum.HumanoidStateType.Jumping then
spinballmodule.CreateSpinJump()
jumpSound:Play()
elseif newstate == Enum.HumanoidStateType.Landed then
spinballmodule.DestroySpinJump()
landSound:Play()
end
end)
Video showcasing the landing sound only working:
robloxapp-20221230-1531090.wmv (1.7 MB)
Any help on this? Very confused.