How to make particle enabled and visible to everyone if player has a certain tool in their BACKPACK?

Okay. It is still doing the same thing but now when I physically equip the tool (Light) the effects disappear.

if ur physically equipping the tool, you should use tool.Equipped and tool.Unequipped

where would that go in the script?

if you are physically using a tool to activate the effect then you have to put the local script in the tool

just to make clear of what my goal is: I’m trying to make particles that are parented to a part called HitCube which is parented to the player to be enabled when the player has a certain tool in their Backpack.

Example: Player presses TextButton to put the tool called “Light” in their backpack. Once that is done, the effects in HitCube will be enabled. The effects will be enabled regardless if the player physically equips it or not. As long as the player has that tool in their backpack, the effects will be enabled and visible to everyone. If the player doesnt have that tool in their backpack (weather they died, dropped it, etc.) then the effects will be disabled.

Wait i get what you mean now it is because when u equip a tool from the backpack it goes to the player
so it will activate the function backpack.ChildRemoved if thats so then im going to change the function real quick

1 Like

that is precisely what I mean.

In the local script, you have to define the clients character – Player.Character
local character = Player.Character

in the local function,
local function Check_For_Tool()
if backpack:FindFirstChild(“Light”) or character:FindFirstChild(“Light”) then
RemoteEvent:FireServer(“Light”)
else
RemoteEvent:FireServer(“LightCanceled”)
end
end
this should fix all the problem now

im getting some erros here:

Hold on im checking to see are there any errors

1 Like


i dont have the problems that you have there maybe its because the position of the ends?

ok so no more errors… but it still has that bug where both ppl can see it on their selves but not on each other. when it should be just that player with the tool who should have it.

hmm thats really awkward maybe you could clone the Light1 and light2 and then parent it to data.HumanoidRootPart see if it works

local Light1 = HitCube:FindFirstChild(“Light1”):Clone()
local Light2 = HitCube:FindFirstChild(“Light2”):Clone()

and also the lightCanceled part
set the Light1.Parent and Light2.Parent = nil


i did this in my game i cloned the effect and parented it to the player and it works perfectly

1 Like

how would this look in my script? Do I need to delete something? or add anything?

well i defined the clone inside the RemoteEvent onclientEvent

if data.ActionType == "Light then

local Light1 = HitCube:FindFirstChild(“Light1”):Clone()

so it should look like this?

RemoteEvent.OnClientEvent:Connect(function(data)
if data.ActionType == "Light" then
local Light1 = HitCube:FindFirstChild("Light1"):Clone()
local Light2 = HitCube:FindFirstChild("Light2"):Clone()
	
		if data.ActionType == "Light" then
			Light1.Enabled = true
			Light2.Enabled = true
		elseif data.ActionType == "LightCanceled" then
			Light1.Enabled = false
			Light2.Enabled = false
		end
	end
end)

yeah that should do also add this
if data.ActionType == “Light” then
Light1.Parent = data.Parent
Light2.Parent = data.Parent
Light1.Enabled = true
Light2.Enabled = true

	elseif data.ActionType == "LightCanceled" then
		Light1.Enabled = false
		Light2.Enabled = false
                    Light1.Parent = nil
                    Light2.Parent = nil
1 Like

does this looks right? not too much?

remove the light1 and light2 from line 3 and 4 btw
RemoteEvent.OnClientEvent:Connect(function(data)

local Light1 =  HitCube:FindFirstChild("Light1") :Clone()
local Light2 =  HitCube:FindFirstChild("Light2") :Clone()

if data.ActionType == "Light" then
	
	Light1.Parent = data.Parent
	Light2.Parent = data.Parent
	Light1.Enabled = true
	Light2.Enabled = true
elseif data.ActionType == "LightCanceled" then
	Light1.Enabled = false
	Light2.Enabled = false
	Light1.Parent = nil
	Light2.Parent = nil
end

end)
and try it in game instead of roblox studio sometimes it bugs( for me)

1 Like