Multiple Jumps System // Animation, Gui text, Particle Effect

Greetings Developers,

Today, i’ve made a jump system that allow you to jump multiple times !
This ressource include:

  • The system itself, main settings can be changed.
  • A Gui text which show you how many jump remaining you have.
  • A particle effect which appear while jumping in the air.
  • Jump animation is changing while jumping in the air.

Files

Studio: MultipleJumps.rbxl (38,1 Ko)
Roblox: Multiple Jumps - Roblox

Local Script

--// Services //--
local UserInputService = game:GetService("UserInputService")
local WorkspaceStorage = game:GetService("Workspace")
local PlayersStorage = game:GetService("Players")

--// Variables //--
local Player = PlayersStorage.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid" ,10)
local Animate = Character:WaitForChild("Animate", 10)
local Effect = script:WaitForChild("Effect" ,10)

--// Settings //--
local MaxJumps = 3
local BaseJumpPower = 50
local NewJumpPower = 60
local NewJumpTimer = 0.15
local ParticleID = "http://www.roblox.com/asset/?id=275871881"
local AnimationID = "http://www.roblox.com/asset/?id=1083218792"

--// Values //--
local CanJump = false
local CurrentJump = 0

--// Functions //--
local function UpdateText()
	script.Parent.JumpCount.Text = CurrentJump.. "/" ..MaxJumps
end

local function PlayEffect()
	local Clone = Effect:Clone()
	Clone.CFrame = Character.PrimaryPart.CFrame
	Clone.Particle.Texture = ParticleID
	Clone.Particle.Enabled = true
	Clone.Parent = WorkspaceStorage	
	wait(0.5)
	Clone.Particle.Enabled = false
	wait(1)
	Clone:Destroy()
end

local function JumpRequest()
	if CanJump == true and CurrentJump < MaxJumps then
		CanJump = false
		Humanoid.JumpPower = NewJumpPower
		Animate.jump.JumpAnim.AnimationId = AnimationID
		Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
		PlayEffect()
	end
end

local function Setting(State)
	if State == Enum.HumanoidStateType.Landed then
		CanJump = false
		CurrentJump = 0
		Humanoid.JumpPower = BaseJumpPower
		Animate.jump.JumpAnim.AnimationId = "http://www.roblox.com/asset/?id=507765000"
		UpdateText()
	elseif State == Enum.HumanoidStateType.Jumping then
		CurrentJump += 1
		UpdateText()
		wait(NewJumpTimer)
		CanJump = true		
	end
end

--// Connections //--
UpdateText()
Humanoid.StateChanged:Connect(Setting)
UserInputService.JumpRequest:Connect(JumpRequest)
11 Likes