Hi so what i’m trying to achieve is that I want to make my little tank where my HumanoidRootPart is. I did the code but it results in this :
Code
-- SERVICES >--
local ss = game:GetService("ServerStorage")
----------------------------------------------
--< VARIABLES >--
local tanks = ss:WaitForChild("Tanks")
----------------------------------------------
--< CODE >--
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local tankModel = tanks:FindFirstChild(player.Stats.Tank.Value):Clone()
tankModel.Parent = character
local weld1 = Instance.new("WeldConstraint")
weld1.Parent = tankModel
weld1.Part0 = tankModel:FindFirstChild("Cannon_Outline")
weld1.Part1 = humanoidRootPart
local weld2 = Instance.new("WeldConstraint")
weld2.Parent = tankModel
weld2.Part0 = tankModel:FindFirstChild("Cannon")
weld2.Part1 = humanoidRootPart
local weld3 = Instance.new("WeldConstraint")
weld3.Parent = tankModel
weld3.Part0 = tankModel:FindFirstChild("Main_Outline")
weld3.Part1 = humanoidRootPart
local weld4 = Instance.new("WeldConstraint")
weld4.Parent = tankModel
weld4.Part0 = tankModel:FindFirstChild("Main")
weld4.Part1 = humanoidRootPart
end)
end)
The tank is welded to my HumanoidRootPart but it’s not in the right position.
Any idea of why this is happening?