I need help with my base save system

my script takes the hitbox rotation from the model but gives it 0,0,0 in all axes


	for i, partsOnBase in pairs(plrfold:GetChildren()) do
		if(partsOnBase:IsA('Part')) then
			local tables = {PosX = partsOnBase.Position.X, PosY = partsOnBase.Position.Y, PosZ = partsOnBase.Position.Z, AnglX = partsOnBase.CFrame.Rotation.X, AnglY = partsOnBase.CFrame.Rotation.Y, AnglZ = partsOnBase.CFrame.Rotation.Z, PartType = partsOnBase.Name}

			table.insert(BasePartsOwned, tables)

			partsOnBase:Destroy()
		elseif partsOnBase:IsA('Model') then
			local tables = {PosX = partsOnBase.HitBox.Position.X, PosY = partsOnBase.HitBox.Position.Y, PosZ = partsOnBase.HitBox.Position.Z , AnglX = partsOnBase.HitBox.CFrame.Rotation.X, AnglY = partsOnBase.HitBox.CFrame.Rotation.Y, AnglZ = partsOnBase.HitBox.CFrame.Rotation.Z, PartType = partsOnBase.Name}
			
			table.insert(BasePartsOwned, tables)
			
			print(partsOnBase.Name)
			print(tables)
			
			partsOnBase:Destroy()
		end
	end

how i can fix that?

1 Like

There’s a lot of problems, first table.insert() needs the first param to be a table and the second be the object.
I assume BasePartsOwned is also a table? May you please provide the whole script, as things like plrfold,BasePartsOwned etc. are simply not found in the script given. Providing the whole script will help fixing your problem! Also your goal is to get hitbox rotations, first I dont get what do you mean by hitbox rotaations, where are the hitboxes? Where are they created? So please provide me with the whole script and possibly related scripts!

1 Like

Also I don’t think it’s very suitable to use CFrame.Rotation, instead I think you can try Orientation and test! I will follow up tmr since I have to sleep in my time region.

Edit: This post below may also help with similar issues with yours:
https://devforum.roblox.com/t/how-to-get-the-rotation-of-something/2158885?u=soprosostupid

1 Like