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

How to enable ParticleEmitter when jumping?

Asked by 7 years ago

Hey! So I am creating a game on Roblox called Sonic Brisk and just like any Sonic game, the character is supposed to turn into a ball when they jump. Now, the way I'm recreating this effect is by using Particle Emitters. So, the idea is that when the character jumps, the Particle Emmiter (which will be welded to the Torso or HumanoidRootPart) will be enabled and you'll see the spinning spike particles. The way I thought of doing this would be to make a script that will clone the part (with the Particle Emitter as it's child) onto the HumanoidRootPart or Torso and then Enable the Particle Emmiter when the player jumps. Does anyone have any idea how this could be accomplished?

1 answer

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

Added some fixes to the script.

01-- First off, put the particle emitter in Server-storage.
02-- Then Change the "Enabled" Value to "false".
03-- change everything necessary in the script.
04-- Put the script in Server-Script-Service.
05-- And that's it!
06 
07game.Players.PlayerAdded:Connect(function(player)
08    local va = Instance.new("StringValue")
09    local Val = va.Value
10    Val = player.Name
11    game.ServerStorage.Particle:Clone().Parent = game.Workspace.Val.Torso -- Change "Particle", to the name of it.
12    game.Workspace.Val.Humanoid.Jump = false
13    function onKeyPress(inputObject, gameProcessedEvent)
14        if inputObject.KeyCode == Enum.KeyCode.Space then
15            game.Workspace.Val.Humanoid.Jump = true
View all 32 lines...
Ad

Answer this question