I’m trying to make a script that enabled particles/Lights on my custom startercharacter when the player has a certain tool in their BackPack. If they dont have the tool in their backpack then the particles/lights will be disabled. I also can’t seem to find a way to make EVERYONE see the particles/lights on you. I’ve tried local and server scripts. but all I can pretty much provide is the local script located in startercharacterscripts:
local HitCube = script.Parent:FindFirstChild("HitCube") --HitCube is a part inside the custom startercharacter that contains all the effects/lights.
LightLight = HitCube:FindFirstChild("LightLight") --pointlight
Light1 = HitCube:FindFirstChild("Light1") --particle 1
Light2 = HitCube:FindFirstChild("Light2") --particle 2
local Player = game:GetService("Players").LocalPlayer
function checkForTool()
if Player.Backpack:WaitForChild("Light") then --Name of the tool
LightLight.Enabled = true
Light1.Enabled = true
Light2.Enabled = true
else
LightLight.Enabled = false
Light1.Enabled = false
Light2.Enabled = false
end
end
Player.Backpack.ChildAdded:Connect(checkForTool)
Player.Backpack.ChildRemoved:Connect(checkForTool)
And here’s a picture of the HitCube containing all the effects/lights located in the custom startercharacter:
tysm for helping! but I’m not a good scripter at all so I’m not sure how that would look in this script. (idk where to type that at in my current script). Also is having the script that I’m using a localscript good or bad? like is it the reason why it’s not showing for everyone? Because right now, the script I’m using is making the effects show but only for me. I need it to show for everyone.
before I test it, does that first script go into a localscript inside StarterCharacterScripts? and does that second Sever Script go into StarterCharacterScripts as well?
the first scripts goes in the startercharacterscripts because you wouldnt really want to put it in starterplayerscripts because if you do that, the script will only fire once when the player joins
second, you should put it in serverscriptservice because you wouldnt be able to use a server script in a startercharacterscript
i fixed the code quite a bit so now if the player have the item it will have the effect permanently
and if the player have the effect and the item is gone then it would be removed
it works! but one thing… instead of making the particles disappear after 10 sec. I want it to be enabled as long as the player has the tool in their BackPack. And will be disabled when the player doesnt have that tool in their backpack.
uhm… there’s a bug. I tested it with another player and when I equipped the Light tool, I could see the effects on myself, but on the other player’s screen… they also see the effects but on their self and not on me. And the other player didn’t even have the tool.