We use cookies on this site to enhance your user experience

Converting Experimental Mode Games: Code Sample 12

Converting Experimental Mode Games: Code Sample 12

local tool = script.Parent

local createsSparklesEvent = tool.CreateSparkles

local function onCreateSparklesFired(player, humanoidRootPart)
	if humanoidRootPart and humanoidRootPart.Name == "HumanoidRootPart" and not humanoidRootPart:FindFirstChild("Sparkles") then
		Instance.new("Sparkles", humanoidRootPart)
	end
end

createsSparklesEvent.OnServerEvent:Connect(onCreateSparklesFired)