Through a local script, I turn particles on and off by enabling them. I also have filtering enabled on. The problem is, no matter what I do they always show up on all the clients. I tried cloning the particles through the local script and stuff, but it just never works. The script is in the starter character and I tried moving it to other places to see if it would work. I tried having the particles cloned from replicated first and replicated storage. I also tried testing in the studio and in just a normal Roblox server. Am I just dumb and not realizing that I have to do something else? The particles don't show up on the server, but on every single client.
All my script does is create a sound, play a sound, turn on some particles, wait for the sound to finish, then destroy the sound and then disable all the particles. I'll put some of that script if it helps but I really don't understand what is going on!
I really need help I've been looking up stuff on the internet for a couple of days now!
local replicatedfirst = game:WaitForChild('ReplicatedFirst') local stuff = game.Workspace.TutorialStuff local confetti1 = stuff.Confetti1 local confetti2 = stuff.Confetti2 local part = stuff["Confetti Trigger"] local debounce = false local player = game.Players.LocalPlayer part.Touched:Connect(function(hit) if not hit.Parent:FindFirstChild("Humanoid") then return end if hit.Parent.Humanoid.Health == 0 then return end if debounce == true then return end debounce = true local particle1 = confetti1:GetChildren('ParticleEmitter') local particle2 = confetti2:GetChildren('ParticleEmitter') local sound = Instance.new('Sound') sound.Parent = hit.Parent sound.SoundId = 'rbxassetid://2762666255' sound.Name = 'PartySirens' sound.Volume = 0.5 sound:Play() for i = 1, #particle1 and #particle2 do particle1[i].Enabled = true particle2[i].Enabled = true end repeat wait() until sound.TimePosition >= 6.3 for i = 1, #particle1 and #particle2 do particle1[i].Enabled = false particle2[i].Enabled = false end sound:Destroy() debounce = false end)
stuff = where everything is located in workspace
confetti1/2 = part that contains particles
One answer: Use RemoteEvents
.
RemoteEvents can be used to send information from client(s) to server or server to client(s).
--Client script (LocalScript) game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(player) --particle code here, yada yada, etc etc. end)
Learn about RemoteEvents here: https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events