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

game.Players.PlayerAdded:Connect(function(plr) -- fires when a player joins and creates a var plr
    local Status = Instance.new('Folder') -- create a folder
    Status.Name = "Status" -- changes the name of the new folder to status
    Status.Parent = plr -- the parent of this folder is plr

    local Sprinting = Instance.new('BoolValue') -- the boolvalue
    Sprinting.Name = "Sprinting" -- Changes name
    Sprinting.Value = false -- the player is not sprinting so false
    Sprinting.Parent = Status -- this will be sent to the folder status
end)

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;
local Sprinting = game.Players.LocalPlayer:WaitForChild("Status").Sprinting -- teh variable
local Particles = game.ReplicatedStorage:WaitForChild("PartilceName")

-- something:Connect(function()
    Sprinting.Value = true -- changes sprinting to true
    -- you code that adds speed and everything 
    local CP = Particles:Clone()
    CP.Parent = -- playerrs torso (add it your self)
    if Sprinting = false then
        CP:Destroy()
    end
end)

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