The answer above was correct but, he did not show examples. So I will be teaching you step by
step. Follow the steps below:
- Make sure you have the Particle in
ReplicatedStorage
- 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
01 | game.Players.PlayerAdded:Connect( function (plr) |
02 | local Status = Instance.new( 'Folder' ) |
03 | Status.Name = "Status" |
06 | local Sprinting = Instance.new( 'BoolValue' ) |
07 | Sprinting.Name = "Sprinting" |
08 | Sprinting.Value = false |
09 | Sprinting.Parent = Status |
Notes from this script:
- When doing something like :connect(function() use connect with a cap C. so it would look like :Connect instead of :connect
- If this script doesn't function, then add a wait(0.5) on the top line of Status
- Do not place ServerScripts (normal scripts) inside of
Workspace
. There's a reason **ServerScriptService**
Exists.
Now continuing;
- Make sure you have some way to sprint; e.x.g: Holding Shift, Clicking a button etc.
- add these line to your code;
01 | local Sprinting = game.Players.LocalPlayer:WaitForChild( "Status" ).Sprinting |
02 | local Particles = game.ReplicatedStorage:WaitForChild( "PartilceName" ) |
05 | Sprinting.Value = true |
07 | local CP = Particles:Clone() |
09 | if Sprinting = false then |
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!