Need help with efficient use of particles

Hello, I am developing a game with blood effects using ParticleEmitters. However these particles are on the server. For reference, I used the :Emit() Function so that I could control the particles. And after about a second the particle will :Destroy because it finished. Should I handle particles on the client or the server even if its very small?

4 Likes

Blind Guess …

Server Script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ParticleEvent = Instance.new("RemoteEvent")
ParticleEvent.Name = "ParticleEvent"
ParticleEvent.Parent = ReplicatedStorage

local function EmitParticles(player, position)
    ParticleEvent:FireClient(player, position)
end

local player = game:GetService("Players"):FindFirstChild("PlayerName")
local position = Vector3.new(10, 5, 10)
EmitParticles(player, position)

Client Script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ParticleEvent = ReplicatedStorage:WaitForChild("ParticleEvent")

local function PlayParticles(position)
    local particleEmitter = Instance.new("ParticleEmitter")
    particleEmitter.Parent = game.Workspace
    particleEmitter.Position = position
    wait(1)
    particleEmitter:Destroy()
end

ParticleEvent.OnClientEvent:Connect(function(position)
    PlayParticles(position)
end)
3 Likes

if only run the emit on humanoid taking damage i think client is the best option to handle since the humanoid always replicated to the client you dont need remote events

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.