Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to make a double jump particle effect?

Asked by 5 years ago

I want to know what i'm suppose to add to this script to make a cartoon like particle effect when someone double jumps. because i'm making a 3d platformer game like super mario 64 or a hat in time.

local UserInputSevice - game:GetSevice("UserInputSevice") local jumptick = tick() local Jumped = 1 local function onInputTypeBegan(input,gameProcessed if input.UserInputType == Enum.UserInputType.Keyboard then local keyPressed = input.keyCode if keyPressed = Enum.Keycode.Space then if Jumped == Enum.keycode.space then if jumped == 1 then jumped = 2 else if Jumped == 2 and tick() - lastjumptick <= .5 then local Jumpbrick.Cframe = instance.new("Part",workspace) JumpBrick.CFrame = game.players.localPlayer.Characther.HumaonidRootpart.CFrame * CFrame.new(0,-2,0) JumpBrick.Size = Vector3.new(5,.2,5) JumpBrick.Anchored = true JumpBrick.Transparency = 1 game.Players.LocalPlayer.Character.Humanoid.JumpPower = 60 game.Derbris:AddItem(JumpBrick,.1) wait(.5) game.Players.LocalPlayer.Character.Humanoid.jumpPower = 50 end wait(5) Jumped = 1 end lastjumptick = tick end end end

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

i had a stroke trying to deconstruct this

anyways:

01local UserInputSevice = game:GetService("UserInputService")
02local plr = game.Players.LocalPlayer
03local char = plr.Character
04local hum = char:WaitForChild("Humanoid")
05 
06local canDJump = false
07local hasDJumped = false
08 
09hum.StateChanged:Connect(function(old, new) --Detects many things, like if you landed or started falling
10    if new == Enum.HumanoidStateType.Landed then --Checks if we landed
11        canDJump = false
12        hasDJumped = false
13    elseif new == Enum.HumanoidStateType.Freefall then --Checks if we're falling
14        wait(0.1) --Waits for we don't jump twice at once
15        canDJump = true
View all 28 lines...

Your whole script was kinda impractical, so I fixed it with my own I wrote in a few minutes. If you'd like me to make sounds/particles then reply!

Ad

Answer this question