#Pet game

1 messages · Page 1 of 1 (latest)

solid thorn
#

Hi, I’m developing a Roblox game called Pet game
I’m handling the building and modeling myself, but I’m looking for guidance on structuring two core scripting systems properly.

  1. Pet AI System
    Pets should wander only inside the owner’s plot
    They must not leave the plot area
    The system should be optimized (no heavy while true loops per pet)

  2. Data Saving System
    Save player cash
    Save rebirth count
    Save pets owned and pets placed
    Ensure it’s secure and prevents duplication or data loss

I want to build this the right way from the start using good practices and a scalable structure

Any advice or recommended approaches would be greatly appreciated.

grave blaze
solid thorn
#

would you recommend generating the random positions using the plots size and CFrame to ensure the pet never leaves the plot?

Also, would it be better to control movement from a central system instead of running a loop inside each pet?

barren baneBOT
#

studio** You are now Level 2! **studio

grave blaze
grave blaze
#

That way it won't require running a "loop"

#

But after some thinking. This advice regading the Pet AI might bad if your Plot has a lot of structures. MoveTo() isn't any kind of Pathfinding. It just takes the shortest path without taking any other objects in Consideration.

solid thorn
#

thats true I didnt think about obstacles I'll keep in mind when designing the plots

solid thorn
grave blaze
solid thorn
#

Ok thank you I'll try 👍

#

I also wanted to ask about data saving. For things like cash, rebirths, and stacked inventory (like Dog x3) what would be the best way to structure that using DataStore? I want to avoid duplication issues

grave blaze
solid thorn
#

Ok thanks

sweet star