Pet System [Open Source]

Who I am

I am a scripter, I have been scripting for 4 months now. I want to give my pet system away for others to learn. I wanted to give this away cause I have transitioned from AGF to knit and using Roblox-TS now.

What is a pet system?

A pet system is usually for the simulator genre. It consist of egg opening, equipping pets (etc.).

What does it contain?

A pet frame and an index.

What datastore?

ProfileService. Saves using tables.

What is the framework used?

Using Aero Game Framework.

What is Aero?

Highly recommend

https://sleitnick.github.io/Knit/

Are there some bad practices?

Yes, it has some memory leaks for egg animation. This can be stopped by destroying the tween instances.

Where is pet frame?

Go to MAINUI in screen gui. And make sure Visible of PetFrame is true.

Do I have to credit?

No.

Fixed

Idk why in the past I used to forget that I should use WaitForChild for instances being created.

FelixPetSystemFixed.rbxl (252.4 KB)

23 Likes

It’s not working I tried publishing the game and checking enable API services and everything but it does not work it gives a lot of errors.

1 Like

Fixing the, right now, sorry. Might take 5 mins.

1 Like

Fixed the instances indexing nil!

1 Like

How do you get the egg when I change my coins value it resets to 0 same with clicks and i cant close the pets frame.

You will have to script the open and close button yourself, the clicks resets because it is saved with tables. In a script you can do,

profile.Data.Clicks += amount

Basic Usage - ProfileService for documentation.

Really cool system, I don’t have a use for this personally; but I can imagine others possibly using it. Great work!

1 Like

Hello,
First of all, your pet system is great. But there is a problem. I don’t know how to send Pets and Coins to someone. How can I do it?

very good source thank you, but I have a problem setting it up

error ServerScriptService.TrelloAPI:701: Roblox API not found!

how do I set up this on Trello website?
–// Trello Vairables
local PetBoardID = TrelloAPI:GetBoardID(“Roblox API”)
local PetListID = TrelloAPI:GetListID(“Pets”, PetBoardID)

I did setup the API and the token but I do not really understand how to set up the Board for the pet

I created a more user friendly system for generating the pet data for the egg hatching process. It automatically generates the correct percentage for the module, and outputs it with the correct value.

Example code:

local PetModuleBuilder = require(script.Parent:WaitForChild("PetModuleBuilder"))

local common = PetModuleBuilder:create()
common:addPet("Spirit God", 1)
common:addPet("Dog", 3)
common:addPet("Poop", 3)

local rare = PetModuleBuilder:create()
rare:addPet("Dog", 3)
rare:addPet("Poop", 3)

An example of integrating it into EggModule:

-- Egg Module
-- Username
-- January 6, 2021

local PetModuleBuilder = require(script.Parent:WaitForChild("PetModuleBuilder"))

local common = PetModuleBuilder:create()
common:addPet("Spirit God", 1)
common:addPet("Dog", 3)
common:addPet("Poop", 3)

local rare = PetModuleBuilder:create()
rare:addPet("Dog", 3)
rare:addPet("Poop", 3)


--// EVERYTHING SORTS BY COST IN INDEX.
local EggModule = {

    ["Common Egg"] = {
		Cost = 250,
		Image = 6289909588,
		Rarities = common:ToEggModule()
	};

	["Rare Egg"] = {
		Cost = 570,
		Image = 6284976641,
		Rarities = rare:ToEggModule()
	};

	
}


return EggModule

Here is what it looks like ingame:

Now you no longer have to fiddle with the values to get it to display correctly! Just add the pets, and thats it!

2 Likes

I keep getting the error “Players.gk983.PlayerScripts.Aero.Controllers.PetAniController:22: attempt to index nil with ‘BodyPosition’” for some reasaon when I have a pet equipped. I checked and the primarypart indeed has the child BodyPosition. I have no idea how to fix this