local h=30 local c=game:GetService("\084\101\120\116\083\101\114\118\105\099\101")game.ReplicatedStorage.Interactions.Server.SetPetName.OnServerInvoke=function(j,f)if string.len(f)<=h then j.Settings.PetName.Value=f for h,M in pairs(game.Players:GetPlayers())do spawn(function()game.ReplicatedStorage.Interactions.Client.SetPetName:FireAllClients(j,(c:FilterStringAsync(f,j.UserId)):GetNonChatStringForUserAsync(M.UserId))end)end return"\078\065\077\069 \083\069\084"else return"\084\079\079 \076\079\078\071"end end

local MAX_LENGTH = 30

local filterService = game:GetService("TextService")

game.ReplicatedStorage.Interactions.Server.SetPetName.OnServerInvoke = function(plr, newName)
	
	-- Check length
	if string.len(newName) <= MAX_LENGTH then
	
		-- Run through filter service and set
		plr.Settings.PetName.Value = newName
		
		-- Set pet name
		for _, i in pairs(game.Players:GetPlayers()) do
			spawn(function()
				game.ReplicatedStorage.Interactions.Client.SetPetName:FireAllClients(plr, filterService:FilterStringAsync(newName, plr.UserId):GetNonChatStringForUserAsync(i.UserId))
			end)
		end
		
		return "NAME SET"
	else
		return "TOO LONG"
	end
	
end
