I’m developing my first game with my friend and we’re absolutly stuck on the entire pet system .
To be honest, we’re lost.
We found a working follow script for the pets but it is not perfect:
local base = script.Parent
local hearth = base.Parent.Parent:WaitForChild(“Head”)
local runservice = game:GetService(“RunService”)
runservice.Stepped:Connect(function()
local cf = hearth.CFrame
local pos = (hearth.CFrame * CFrame.new(-4,1,4)).p
AlvinBlox doesn’t have made a video on how to make an egg hatching system.
Maybe, you’re right with all youtube videos i can problably make the egg hatching system but I still have a problem on Pet data saving and Pet inventory
How are you attempting to store the pet data? Also if you haven’t used DataStore2 by @Kampfkarren you should consider doing that, as it is a reliable DataStore Module.
There is a really good egg hatching video on YouTube. You can check it out here. As for the pets, the best thing to do is look at a free model, study the scripts, then try making your own. Hope this helps!
I already seen this video, it helps me a lot but i was looking for a solution on how to change the click detector to a “E pressed function”.
And how i said before, i’m probably able to make my egg hatching system,
but there is still two problems wich are the pet storage and the pet inventory (Equip/Unequip)
Thank you for your help!
You can check the distance from the player and the part (the magnitude). If it’s your desired distance, then make a billboard gui show up. After that, you can use UserInputService to see if the player has pressed “e”.
Does anyone of you have an idea on how can i make a pet inventory like show the pet icon and how to make an equip and unequip. I don’t know how to put the pet after getting it after the egg hatching
local petData = {
n = "petName";
cn = "petCustomName";
id = game:GetService("HttpService"):GenerateGUID(false); -- unique id
e = false; -- equipped
xp = 0;
};
For setting networkownership when you spawn the pet in the server you would use something like this:
-- Task: Set pet PrimaryPart network owner to player
local pet = petDir[pet]:Clone()
pet.Parent = workspace
pet.PrimaryPart:SetNetworkOwner(player)
-- Next in a LocalScript you would control the physics or whatever you want to do and it will automatically replicate to the server
Thank you so much for all your help and support.
I’m not on Roblox Studio right now.
I will try all of this tomorow (Eur. hour)
See ya later,
I’ll give you a feedback
To make the pet follow the player, I need to use the “ToMove” function to make the entire pet model follow the player, (to exploit the PrimaryPart, that’s it?