Pet hide script

I want the player to hide their pets thanks to a local script.
The player who requested this no longer sees his own pets.
However, other players may not allow the requesting player’s pets to
they see it fixed where the player left it.
In fact, other players should see that the pet of the player who requested it is still following him.
how can i fix this error?

function module.Hide_Yours_Pets()
	local HidePets = GetSettingByID("Hide_Yours_Pets")
	if HidePets.Enabled  then
		local petsH = character.Pets
		local petsH2 = petsH:GetChildren()
		for i =1,#petsH2  do
			petsH2[i].Parent = ReplicatedStorage.HidePets
			end
	else
		local petsH = ReplicatedStorage.HidePets
	local petsH2 = petsH:GetChildren()
		for i =1,#petsH2  do
			petsH2[i].Parent = character.Pets
			end
	end
end

Screenshot 2022-12-22 161456
Screenshot 2022-12-22 161510

You are trying to hide pets from the client but the pets be visible for the server?

I hide the pets from the client and want them to be still visible from the other player’s client and follow the owner. but they stand still as in the picture and do not follow

In a local script (or the local side of a module script) can you not just loop through all the pets the user has and make the transparency so they cannot be seen (or destroy them if u rather that)?

I will take that as a yes, in that case just make a “UI” button that makes the pets invisible and that’s it, let me give you an example.

– [ UI LocalScript ] –

local Button = script.Parent
local Switch = false
Button.MouseButton1Click:Connect(function()
      if Switch ~= true then
           workspace.Player.pet.Transparency = 1
           workspace.Player.pet.CanCollide = false
           Switch = true
     else
           workspace.Player.pet.Transparency = 0
           workspace.Player.pet.CanCollide = true
           Switch = false
     end
end)

You know what I mean?

Screenshot 2022-12-22 175755
I understand what you mean. but what you see in the picture is the contents of a pet of mine. I just tried this method because I couldn’t find how to choose just mesh parts and decal .
if i can choose these i can do what you say

Use pairs:

for i, v in pairs(Pet:GetDescendants()) do
       if v:IsA("Part") then
            Part.Transparency = 1
            Part.CanCollide = false
      elseif v:IsA("Decal") then
             ImageTransparency = 1
      end
end
1 Like

I didn’t succeed, but I’m trying. but this is definitely the solution thanks

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.