So, i have made 3 local scripts for the Player’s Character, they all work completely fine, but once you die they stop working, but i don’t understand why ! They are all located in StarterCharacterScripts, and i made sure to define the Player’s Character using local Character = Player.Character or Player.CharacterAdded:Wait()
. There are no errors/warnings in the Output. Here are the scripts :
Triple Jump Script:
--//Variables//--
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Root = Character:WaitForChild("HumanoidRootPart")
local Step = Root:WaitForChild("StepTJ")
local Whoosh = Root:WaitForChild("WhooshTJ")
local Jump1 = script:WaitForChild("Jump 1")
local Jump2 = script:WaitForChild("Jump 2")
local Jump3 = script:WaitForChild("Jump 3")
local JumpAnim1 = Humanoid:LoadAnimation(Jump1)
local JumpAnim2 = Humanoid:LoadAnimation(Jump2)
local JumpAnim3 = Humanoid:LoadAnimation(Jump3)
JumpAnim1.Priority = Enum.AnimationPriority.Action3
JumpAnim2.Priority = Enum.AnimationPriority.Action3
JumpAnim3.Priority = Enum.AnimationPriority.Action3
----------------------------------------------------
Jump = 0
isJumping = false
isFalling = false
-------------------------------------------------------
--//Functions//--
function onJump(Val)
isJumping = Val
if isJumping and Jump > 1 and Jump < 3 then
Humanoid.JumpPower = 50
Jump = 3
JumpAnim3:Play()
JumpAnim3:AdjustSpeed(1.75)
Step:Play()
Whoosh:Play()
Root.Velocity = Root.Velocity + Vector3.new(0, 95, 0)
task.wait(0.2)
Whoosh:Play()
task.wait(0.35)
Whoosh:Play()
Jump = 0
elseif isJumping and Jump > 0 and Jump < 2 then
Humanoid.JumpPower = 50
Jump = 2
JumpAnim2:Play()
JumpAnim2:AdjustSpeed(0.5)
Step:Play()
Root.Velocity = Root.Velocity + Vector3.new(0, 75, 0)
elseif isJumping and Jump < 1 then
Humanoid.JumpPower = 50
Jump = 1
JumpAnim1:Play()
JumpAnim1:AdjustSpeed(0.75)
Step:Play()
end
end
---------------------------------------------
function onFall(Val)
isFalling = Val
if not Val then
task.wait(0.25)
if Jump > 0 and not isFalling then
Jump = 0
end
end
end
--//Connections//--
Humanoid.Jumping:Connect(onJump)
Humanoid.FreeFalling:Connect(onFall)
Walking Effects Script :
--//Variables//--
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Root = Character:WaitForChild("HumanoidRootPart")
local Footstep = Root:WaitForChild("SteppingSound")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
----------------------------------------------------
--//Function//--
function onHumanoidRunning(Speed)
if Speed > 6 then
Footstep.Playing = true
else
Footstep.Playing = false
end
end
----------------------------------------------------
function onHumanoidNotRunning()
Footstep.Playing = false
end
--//Connections//--
Humanoid.Running:Connect(onHumanoidRunning)
Humanoid.Jumping:Connect(onHumanoidNotRunning)
Humanoid.FreeFalling:Connect(onHumanoidNotRunning)
Humanoid.Swimming:Connect(onHumanoidNotRunning)
Landing Effects Script :
--//Variables//--
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Root = Character:WaitForChild("HumanoidRootPart")
local Landing = script:WaitForChild("Landing")
local LandingAnim = Humanoid:LoadAnimation(Landing)
local LandingSound = Root:WaitForChild("LandingSound")
--//Function//--
function onHumanoidStateChanged(_, State)
if State == Enum.HumanoidStateType.Landed then
LandingAnim:AdjustSpeed(5)
LandingAnim:Play()
LandingSound:Play()
---------------------------------------------------
local CloudPart = Instance.new("Part", Character)
CloudPart.Anchored = true
CloudPart.CanCollide = false
CloudPart.CanTouch = false
CloudPart.Position = Root.Position - Vector3.new(0, 2.5, 0)
CloudPart.Size = Vector3.new(2.5, 2.5, 2.5)
CloudPart.Material = Enum.Material.Neon
CloudPart.BrickColor = BrickColor.new(255, 255, 255)
--------------------------------------------------------
local CloudMesh = Instance.new("SpecialMesh", CloudPart)
CloudMesh.Scale = Vector3.new(0.05, 0.025, 0.05)
CloudMesh.MeshId = "rbxassetid://11978515144"
--------------------------------------------------------
local TweenService = game:GetService("TweenService")
local TweenInfo1 = TweenInfo.new(0.25, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local TweenSize = TweenService:Create(CloudMesh, TweenInfo1, {Scale = Vector3.new(0.15, 0.025, 0.15)})
local TweenTransparency = TweenService:Create(CloudPart, TweenInfo1, {Transparency = 1})
TweenSize:Play()
TweenTransparency:Play()
task.wait(0.3)
CloudPart:Destroy()
end
end
--//Connection//--
Humanoid.StateChanged:Connect(onHumanoidStateChanged)
I seriously have no idea what could be causing this. Please help!