Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I have an issue with player particles only showing for the person using them , how do I fix it?

I have a gui that's supposed to give players different particle effects. Everything works fine except for the fact that the particles only show up for the people using them. I know the issue is probably that everything uses a local script, but I still want the gui to be local, just not the particles. How do I accomplish this?

This script is inside a tool by the way, as the gui only appears when holding a mirror to change your appearance.

local folder = game.ReplicatedStorage.Effects
local Pink = script.Parent.Pink
local Blue = script.Parent.Blue
local Purple = script.Parent.Purple
local plr = game.Players.LocalPlayer
local char = plr.Character

Pink.MouseButton1Click:Connect(function()
	local ParticleEmitter = folder.Pink:Clone()
	local ParticleEmitter2 = folder.Pink:Clone()
	local ParticleEmitter3 = folder.Pink2:Clone()
	ParticleEmitter.Parent = char.LeftFoot
	ParticleEmitter2.Parent = char.RightFoot
	ParticleEmitter3.Parent = char.UpperTorso
end)


Blue.MouseButton1Click:Connect(function()
	local ParticleEmitter = folder.Blue:Clone()
	local ParticleEmitter2 = folder.Blue:Clone()
	local ParticleEmitter3 = folder.Blue2:Clone()
	ParticleEmitter.Parent = char.LeftFoot
	ParticleEmitter2.Parent = char.RightFoot
	ParticleEmitter3.Parent = char.UpperTorso
end)


Purple.MouseButton1Click:Connect(function()
	local ParticleEmitter = folder.Purple:Clone()
	local ParticleEmitter2 = folder.Purple:Clone()
	local ParticleEmitter3 = folder.Purple2:Clone()
	ParticleEmitter.Parent = char.LeftFoot
	ParticleEmitter2.Parent = char.RightFoot
	ParticleEmitter3.Parent = char.UpperTorso
end)


1 answer

✓ Accepted answer

You should use Remote Events to create the particles on the server side. If you don't understand how to use Remote Events, now is the time to learn because this comes in handy with problems such as this.

You do not have to move your code into a server script or anything else. But to achieve what you are asking, you will have to put a Remote Event into preferably the ReplicatedStorage somewhere, and you should call on that remote event like this example:

Local Script:


--\\ Identifying the remote events
local rs = game:GetService("ReplicatedStorage")
local YourRemoteEvent1 = rs:FindFirstChild("RemoteEvent1")
local YourRemoteEvent2 = rs:FindFirstChild("RemoteEvent2")
local YourRemoteEvent3 = rs:FindFirstChild("RemoteEvent3")

--\\ Your variables
local folder = game.ReplicatedStorage.Effects
local Pink = script.Parent.Pink
local Blue = script.Parent.Blue
local Purple = script.Parent.Purple
local plr = game.Players.LocalPlayer
local char = plr.Character

--\\ Firing the Events from your local script 
Pink.MouseButton1Click:Connect(function()
	YourRemoteEvent1:FireServer(plr) -- Call on the remote Event
end)


Blue.MouseButton1Click:Connect(function()
    YourRemoteEvent2:FireServer(plr) -- Call on the remote Event
end)


Purple.MouseButton1Click:Connect(function()
    YourRemoteEvent3:FireServer(plr) -- Call on the remote Event
end)

Finally you will insert your server script into the ServerScriptService to connect your function to the RemoteEvent on the server side.

Server Script:

--\\ Identifying the remote events
local rs = game:GetService("ReplicatedStorage")
local YourRemoteEvent1 = rs:FindFirstChild("RemoteEvent1")
local YourRemoteEvent2 = rs:FindFirstChild("RemoteEvent2")
local YourRemoteEvent3 = rs:FindFirstChild("RemoteEvent3")

YourRemoteEvent1.OnServerEvent:Connect(function(plr)
	--\\ Your function that happens on the server side
	local player = plr
	repeat wait() until plr.Character
	local char = plr.Character

	local ParticleEmitter = folder.Pink:Clone()
	local ParticleEmitter2 = folder.Pink:Clone()
	local ParticleEmitter3 = folder.Pink2:Clone()
	ParticleEmitter.Parent = char.LeftFoot
	ParticleEmitter2.Parent = char.RightFoot
	ParticleEmitter3.Parent = char.UpperTorso
end)

YourRemoteEvent2.OnServerEvent:Connect(function(plr)
	--\\ Your function that happens on the server side
	local player = plr
	repeat wait() until plr.Character
	local char = plr.Character

	local ParticleEmitter = folder.Blue:Clone()
	local ParticleEmitter2 = folder.Blue:Clone()
	local ParticleEmitter3 = folder.Blue2:Clone()
	ParticleEmitter.Parent = char.LeftFoot
	ParticleEmitter2.Parent = char.RightFoot
	ParticleEmitter3.Parent = char.UpperTorso
end)

YourRemoteEvent3.OnServerEvent:Connect(function(plr)
	--\\ Your function that happens on the server side
	local player = plr
	repeat wait() until plr.Character
	local char = plr.Character

	local ParticleEmitter = folder.Purple:Clone()
	local ParticleEmitter2 = folder.Purple:Clone()
	local ParticleEmitter3 = folder.Purple2:Clone()
	ParticleEmitter.Parent = char.LeftFoot
	ParticleEmitter2.Parent = char.RightFoot
	ParticleEmitter3.Parent = char.UpperTorso
end)

Here is a link to the wiki for Remote Events:

https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events

1 comment

0

Helped! Thanks so much!

This discussion is preserved as it was. New answers, comments, and votes are closed.