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

How would I put particle effects on a player?

Asked by 7 years ago

Im trying to make a sprint script and when you sprint it has a wind particle effect. i tried to weld particles to the player but that didnt work and i tried to insert particles into the arms and stuff but no results. I would like to find out how to do this!

2 answers

Log in to vote
0
Answered by 7 years ago

The answer above was correct but, he did not show examples. So I will be teaching you step by step. Follow the steps below:

  1. Make sure you have the Particle in ReplicatedStorage
  2. Make sure that you have a **BoolValue** that will bet set to true when the player is sprinting.

If you don't have 2 done then write this simple code and place it in ServerScriptService

01game.Players.PlayerAdded:Connect(function(plr) -- fires when a player joins and creates a var plr
02    local Status = Instance.new('Folder') -- create a folder
03    Status.Name = "Status" -- changes the name of the new folder to status
04    Status.Parent = plr -- the parent of this folder is plr
05 
06    local Sprinting = Instance.new('BoolValue') -- the boolvalue
07    Sprinting.Name = "Sprinting" -- Changes name
08    Sprinting.Value = false -- the player is not sprinting so false
09    Sprinting.Parent = Status -- this will be sent to the folder status
10end)

Notes from this script:

  1. When doing something like :connect(function() use connect with a cap C. so it would look like :Connect instead of :connect
  2. If this script doesn't function, then add a wait(0.5) on the top line of Status
  3. Do not place ServerScripts (normal scripts) inside of Workspace. There's a reason **ServerScriptService** Exists.

Now continuing;

  1. Make sure you have some way to sprint; e.x.g: Holding Shift, Clicking a button etc.
  2. add these line to your code;
01local Sprinting = game.Players.LocalPlayer:WaitForChild("Status").Sprinting -- teh variable
02local Particles = game.ReplicatedStorage:WaitForChild("PartilceName")
03 
04-- something:Connect(function()
05    Sprinting.Value = true -- changes sprinting to true
06    -- you code that adds speed and everything
07    local CP = Particles:Clone()
08    CP.Parent = -- playerrs torso (add it your self)
09    if Sprinting = false then
10        CP:Destroy()
11    end
12end)

Notes: 1. You have to add the place where the particles go 2. I wrote everything from scratch, fix any mistakes. 3. you have to detect if the player's sprinting or not and set sprinting to false when the player stops 4. If you followed everything then this should work.

Good Luck And Have Fun Developing!

0
thanks! supamaster888 28 — 7y
Ad
Log in to vote
1
Answered by
DanzLua 2879 Moderation Voter Community Moderator
7 years ago

You don't really need to weld anything, heres how I would do it, I would put a particles instance inside the torso of the character and then when they are sprinting I would enable it. theres not much to it.

0
Insert particle emitter inside the player's torso or any body part make sure its enabled and check the transparency as well RedPandaEmperor 45 — 7y

Answer this question