How do I make it so every player can see the players equipped particle effect?

I am making a game which has particle effects players can buy in-game and it works just fine but I want all players to see the player’s particle effect when they equip it not just the local player here are both the scripts:

Local script

local function equipRick()
	if RickValue.Value == true then
		if purchaseImg.Image == "rbxassetid://13013809023" then
			game:GetService('ReplicatedStorage'):WaitForChild('Events'):WaitForChild('BindableEvent'):WaitForChild('GamePassEvents'):WaitForChild('EquipBindableEvent'):Fire("Rick")
		end
	end
end

local function equipDog()
	if dogValue.Value == true then
		if purchaseImg.Image == "rbxassetid://13014229857" then
			game:GetService('ReplicatedStorage'):WaitForChild('Events'):WaitForChild('BindableEvent'):WaitForChild('GamePassEvents'):WaitForChild('EquipBindableEvent'):Fire("Dog")
		end
	end
end

local function equipBag()
	if moneyBagValue.Value == true then
		if purchaseImg.Image == "rbxassetid://13014013620" then
			game:GetService('ReplicatedStorage'):WaitForChild('Events'):WaitForChild('BindableEvent'):WaitForChild('GamePassEvents'):WaitForChild('EquipBindableEvent'):Fire("Bag")
		end
	end
end

second local script:

local event = game:GetService('ReplicatedStorage'):WaitForChild('Events'):WaitForChild('BindableEvent'):WaitForChild('GamePassEvents'):WaitForChild('EquipBindableEvent')
local part = script.Parent
local emitter = part:WaitForChild('Emiter')

local function changeP(value)
	if value == "Rick" then
		emitter.Texture = "rbxassetid://13013809023"
		emitter.Enabled = true
	end
	if value == "Dog" then
		emitter.Texture = "rbxassetid://13014229857"
		emitter.Enabled = true
	end
	if value == "Bag" then
		emitter.Texture = "rbxassetid://13014013620"
		emitter.Enabled = true
	end
	if value == "Toggle" then
		emitter.Enabled = false
	end
end

event.Event:Connect(changeP)

I know if I use a local script only the local player can see the effect but when I use a server script the particle effects will apply to all players not just the one who equipped the effect, thanks.

Can you tell where you put your local scripts and tell what is Emiter

They are both here:


if you put your script each of the side: Client and Server?

The issue is that your dealing with the emitters locally in a local script. What you need to do is run the emitter stuff (setting the texture and enabling it) server side inside of a server script.

The reason why is because things done on the client side such as editing things in the workspace don’t get replicated to the server (filtering enabled it is called I believe).

I tried to use a server script originally but the particle effect would enable all players and not just the one who enabled it, thanks

You would need to specify the user you want to do it to it seems like would fix your issue.

these were my original script’s

Local Script:

local function equipRick()
	if RickValue.Value == true then
		if purchaseImg.Image == "rbxassetid://13013809023" then
			equipEvent:FireServer("Rick", plr.UserId)
		end
	end
end

local function equipDog()
	if dogValue.Value == true then
		if purchaseImg.Image == "rbxassetid://13014229857" then
			equipEvent:FireServer("Dog", plr.UserId)
		end
	end
end

local function equipBag()
	if moneyBagValue.Value == true then
		if purchaseImg.Image == "rbxassetid://13014013620" then
			equipEvent:FireServer("Bag", plr.UserId)
		end
	end
end

Server Script:

local function changeP(plr, value)
	if value == "Rick" then
		emitter.Texture = "rbxassetid://13013809023"
		emitter.Enabled = true
	end
	if value == "Dog" then
		emitter.Texture = "rbxassetid://13014229857"
		emitter.Enabled = true
	end
	if value == "Bag" then
		emitter.Texture = "rbxassetid://13014013620"
		emitter.Enabled = true
	end
end

event.OnServerEvent:Connect(changeP)

Where are you getting the emmitter from in the server script?

The script is under a part which the emitter and the script both are.

What each player has an emitter and a script in the emitter? If so that would be your issue because you have the .OnserverEvent event being fired to all server scripts.

What you would need to do is check if the emitter is in the character of the player who should have it activated on if it is then enable the emitter. I would personally recommend just having one server script inside of the ServerScriptService and then get the emitter from the player which is sent though the remote event as that is better practice.

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