So i made GUI button that Disables your specific particle (Thanks to people who helped me)
Now for some reason, when i click on the button it disable Other people particles
here is the script:
type or paste code here
local Players = game:GetService("Players")
local button = Players.LocalPlayer.PlayerGui.EffectCtrl.SettingEf:WaitForChild("DisInf")
local enabled = true
print("First Work")
local function onCharacterAdded(character)
local Torso = character:WaitForChild("Torso")
if Torso then
local leftCollarAttachment = Torso:FindFirstChild("LeftCollarAttachment")
if leftCollarAttachment then
local aura = leftCollarAttachment:FindFirstChild("InfernusAura") or leftCollarAttachment:FindFirstChild("infernusAura")
if aura then
button.MouseButton1Click:Connect(function()
enabled = not enabled -- toggle enabled value
aura.Enabled = enabled
print("Torso FOUND")
end)
else
print("InfernusAura not found")
end
else
print("LeftCollarAttachment not found")
end
else
print("Torso not found")
end
end
-- Access characters in Workspace
for _, player in ipairs(Players:GetPlayers()) do
local character = player.Character or player.CharacterAdded:Wait()
if character then
print(player.Name .. " found in Workspace")
onCharacterAdded(character)
else
print(player.Name .. " not found in Workspace")
end
end
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(onCharacterAdded)
if player.Character then
onCharacterAdded(player.Character)
end
end)
It disables others’ particles because you’re not adding a check to whether the player is the LocalPlayer or not. Paste the following code in a LocalScript inside the button (Players.LocalPlayer.PlayerGui.EffectCtrl.SettingEf:WaitForChild(“DisInf”))
local Players = game:GetService("Players")
local button = script.Parent
print("First Work")
local function onCharacterAdded(character)
local Torso = character:WaitForChild("Torso")
if Torso then
local leftCollarAttachment = Torso:FindFirstChild("LeftCollarAttachment")
if leftCollarAttachment then
local aura = leftCollarAttachment:FindFirstChild("InfernusAura") or leftCollarAttachment:FindFirstChild("infernusAura")
if aura then
button.MouseButton1Click:Connect(function()
if aura.Enabled then
aura.Enabled = false
else
aura.Enabled = true
end
print("Torso FOUND")
end)
else
print("InfernusAura not found")
end
else
print("LeftCollarAttachment not found")
end
else
print("Torso not found")
end
end
-- Access characters in Workspace
for _, player in ipairs(Players:GetPlayers()) do
local character = player.Character or player.CharacterAdded:Wait()
if character and character == Players.LocalPlayer.Character then
print(player.Name .. " found in Workspace")
onCharacterAdded(character)
else
print(player.Name .. " not found in Workspace")
end
end