Need help to make pets

Hey guys,

I’m trying to make pets since 4 months.

I’m stuck and I asked help but I never find awnsers.

It’s why I decided to restart everything.

I made an inventory wich fires a remote event when the player click the equipBut, it will send the petName to the server.

I want to equip the pet and to change the Position of the other equipped pet.

I want to have a different position for each pets for the number of the equipped pets.

Here is an image on what it should look :

(Imagine yellow squares are pets)

Here is the position of my tree pets :

image

And if I equip another one I want all the pets to be repositionned

The first thing is to equip the pet, how am I supposed to do and wich method should I use (bodymovers or alignments?).

Please don’t redirect me to videos or links because I already saw everything I can and I never found my awnsers there)

I need help ;-:
Please

2 Likes

Hey I was working on a pet system recently for an RPG game and this is the simplified pet equip system that I made

It uses align position and align orientation to position the pets around the character. When you fire the equip remote just specify which position the pet is going to go in (1,2,3,4) and thats it. You can mess around with the values of the align position and align orientation to make it better.
Read more here

local Positions = {
	[1] = Vector3.new(4,0,0),
	[2] = Vector3.new(0,0,-4),
	[3] = Vector3.new(-4,0,0),
	[4] = Vector3.new(0,0,4),
}

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		for i,v in pairs(script.Parts:GetChildren()) do
			local Part = v:Clone()
			local Attachment0 = Instance.new("Attachment")
			Attachment0.Parent = Part
			Attachment0.Name = 'Attachment1'
-- This is where the specified number has to go [i]
			Attachment0.Position = Positions[i]
			Part.Parent = Character
			local Attachment1 = Character.HumanoidRootPart:WaitForChild("RootRigAttachment")
			local AlignPosition = Instance.new("AlignPosition")
			AlignPosition.Parent = Part
			AlignPosition.Attachment0 = Attachment0
			AlignPosition.Attachment1 = Attachment1
			local AlignOrientation = Instance.new("AlignOrientation")
			AlignOrientation.Parent = Part
			AlignOrientation.Attachment0 = Attachment0
			AlignOrientation.Attachment1 = Attachment1
		end
	end)
end)
1 Like

Hey there!

Thank you for your awnser!

I like the idea you gave me with the Positions list !

If I am right, this script is in the ServerScriptService Category, and the “Parts” is a folder in the script wich contain the pets?

So how can I know wich pet I have to equip and this sample will run only when the character appears and not when I equip it.

But I have new ideas! Thank you for your help.

I will try things and come back with feedbacks !

Try watching AlvinBlox’s tutorial.

Hey guys !

I’m back!

I just made my Roblox pets system and everything is working, for now i don’t have any problem except of one.

Here is the problem:

I have a problem with one of my pet.

The pet is composed by 3 parts,

A hitbox wich covers the entire pet,
A facepart wich is a transparent part with a face on it
And a meshpart wich is the pet model.

I put two weldconstraints into the hitbox wich Part0 = hit box and Part1 = FacePart and MeshPart
All my parts are non-anchored and non-can collide.

So it works and the result is this :
image

So it is find but here is the problem wich I can’t explain :
image

The facepart is the pink hilighted square and this is the modeled pet:

As you can see, on the modeledPet the facepart is on the meshPart but when I equip the pet the face is “bumped” in front of the meshpart.

I can’t explain it.
I hope I was clear.

Does anyone has an idea to fix this?

Hey there,

I am back!

I tried new things but I still have problems with the positions of my facePart, sometimes it is “bumbed” in front but it never have the great position.

I tried to remake the facePart but it still doesn’t work.
I tried to remove and to remake the weldConstraint but I still have the same problem.
And I tried to weld other parts on the pets and the other parts worked :confused:

I really don’t understand.

Need help,
How can I fix this?

It looks like this with the bug :

image

:confused:

Ok guys, I found the problem.

It looks like it comes from the Orientation of the part.