How would I make a "Enable Blood" button?

I wanted to add blood to a game, but not everyone likes to see blood. How would I make a button that enables and disables the blood effect from the client side?

I searched for a tutorial, but nothing. I have seen this in the game criminality where in the settings menu you can enable or disable blood effects.

Thanks

Anything that is blood tag it as “Blood” with CollectionService and use this function

function Blood(Enable)
	for _,v in pairs(game:GetService("CollectionService"):GetTagged("Blood")) do
		if v:IsA("BasePart") then
			if Enable then
			    v.Transparency = 0
			else
			    v.Transparency = 1
			end
		end
	end
end

to connect it depends on what you use and you should also use GetInstanceAddedSignal in case more is added.

2 Likes