#Code Reference
#Remotes
All under ReplicatedStorage.RidePetRemotes:
| Remote | Type | Use |
|---|---|---|
Action | RemoteFunction | The only way the client asks for something. Action:InvokeServer(name, args) returns { ok = true, state = snapshot, … } or { ok = false, error = code }. |
StateChanged | RemoteEvent | The server pushes a fresh snapshot of the player's state (every second, and after every action). |
Notice | RemoteEvent | A text for the toast at the bottom of the screen. |
HatchPlay | RemoteEvent | Tells every client to play the hatch ceremony for an egg model. |
#Actions
| Action | Arguments | Does |
|---|---|---|
GetState | — | Returns the snapshot. |
GetRadarTargets | — | Returns the positions of map eggs seen by your radars. |
PlaceEggAt | eggId, position | Puts an egg from the inventory in a nest at a point inside your base. |
HatchNest | nestId | Hatches a ready egg. |
DropEgg | — | Drops the egg you carry where you stand. |
PlacePet / StorePet | petId | Puts a pet on the ranch / takes it off. |
PlaceBest | — | Fills free slots with the best-earning pets. |
Mount / Dismount | petId / — | Starts and stops riding. |
Feed | petId, foodId | The pet eats one food. |
BuyFood | foodId | Buys one food. |
BuyLuck | max (optional) | Buys one Hatch Luck level, or as many as you can afford when max is true. |
BuyRadar | radarId | Buys one radar (you can own several). |
UseRadar | radarId | Starts the radar: picks one egg of its rarity and shows it for 5 minutes; the radar is removed when it ends. |
ClaimIndex | tier | Claims an Index reward (rewards are also paid automatically). |
Rebirth | — | Performs the next rebirth if the requirements are met. |
Admin* | see Admin Panel | Admin only. |
Error codes include cash_low, nests_full, not_ready, invalid_egg, invalid_pet, invalid_food, invalid_radar, radar_active, luck_max, pet_required, max_rebirth, rate_limited, too_far, egg_gone, not_in_base, too_close and unknown_action. RidePetUI.State turns each into an English message.
#State snapshot
The table the client draws from: cash, incomePerSecond, pets, basket, nests, food, radars, index, indexEggs, claimed, rebirths, luck, petSlots, basketSlots, worldEggCounts, weather, mounted.
#Server scripts
| Script | Role |
|---|---|
Gameplay | Profiles and saving, plots, map egg rolls, upgrades, the Action dispatcher |
Api | Shared table for the other scripts and pose helpers |
PetSystem | Pets as tools, riding, the ranch pen, pet growth, Index rewards |
EggSystem | Carrying, dropping, placing and hatching eggs |
WeatherSystem | Day/night and storm events |
AdminSystem | The admin actions |
DisplayModels | Copies egg models to RidePetDisplay for the clients |
#Client modules (RidePetUI)
| Module | Role |
|---|---|
State, Windows, Util, Toast | Server state, window open/close, helpers, messages |
Hud, ActionBar | HUD buttons and the contextual action buttons |
Hotbar, Inventory | Hotbar with pictures and the All Items window |
IndexPanel, RebirthPanel, StallPanels, Stalls | Windows and stall interactions |
EggWorld, EggHover, PetWorld, PetRig | Eggs, pets and their animation in the world |
PlotSigns | Hatch Luck sign prompts |
HatchReveal | Pop-up when an egg hatches |
NoKnockdown | Disables knock-down |
AdminPanel | The Admin window |