So i’ve made this script that when the event is fired it clones a Particle into wherever it hits and I’m trying to make a GUI when pressed on/off if off the Particles should be disabled.
Fire Script:
hurt = true -- Damage
for _, child in pairs(wep:GetChildren()) do
if child:IsA("Part") then
child.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil and hurt == true then
soundsclone.Hit:Play()
hit.Parent:FindFirstChild("Humanoid"):TakeDamage(25)
hurt = false
Bleed:Fire(hit)
For your local script you need to have “FireServer()” to actually fire the event instead of just “Fire”. And your server script has to be Bleed.OnserverEvent:Connect(function() to actually connect to the signal and all your damage stuff is best done on the server script along with the cloning.
Ah I have very little experience in BindableEvents, if I were you, I would utilise local scripts to detect the click and a script to execute the function.
The client should be handling particle effects if you want this to be of any usefulness. Instead of firing a BindableEvent, fire a RemoteEvent telling the client it should be simulating blood particles on a part. Then, wherever you store your setting, check if the blood setting is enabled or not. If it is, then proceed to add the blood particles. If not, then don’t do anything. A simple guard clause can handle this.