Help with cloning script

Hi, i just wanted to make the color of the text rarity rainbow, by cloning this script to all pets that contains “_” in the pet’s name.

The problem is, when i try to fire the event, the “pet” is the player, so the script clones in the player.

These are some images:

image
image

OnServerEvent:Connect(function(Player, pet) it should be like this instead.

Now the script isnt cloning at all
image

for _,v:Instance? in container:GetChildren() do
	if string.find(v.Name, "_") then
		Rainbow:FireServer(v)
	else
		continue
	end
end
---
Rainbow.OnServerEvent:Connect(function(Player:player?, Pet)
	local Clone = ServerStorage.Scripts.Rainbow:Clone()
	Clone.Parent = Pet
end)
2 Likes

Same thing, the script doesn’t clone…

What is Pet suppose to be anyway?

In the BillboardGui, there are multiple pets, the giant one has to be the Rarity Text rainbow