You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? I want to weld my hitbox to the head of every character
-
What is the issue? Hitbox(Part) does not weld to the Head. the problem is in line 18 but I dont get an errorcode
-
What solutions have you tried so far? I put in a wait(4) to make sure that the head is loaded and I searched for the head with :WaitForChild()
the script is in serverscriptservice
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local PrimaryPart = character.PrimaryPart
local Head = character:WaitForChild("Head")
local Hitbox = Instance.new("Part",character)
local HeadHitbox = Instance.new("Part",character)
local Headweld = Instance.new("Weld",HeadHitbox)
local Hitweld = Instance.new("Weld",Hitbox)
Hitbox.Name = "BodyHitbox"
HeadHitbox.Name = "HeadHitbox"
Hitbox.Size = PrimaryPart.Size*1.5
HeadHitbox.Size = Head.Size*1.5
HeadHitbox.Position = Head.Position
Hitbox.Position = PrimaryPart.Position
Hitweld.Part0 = Hitbox
Hitweld.Part1 = PrimaryPart
Headweld.Part0 = Head
Headweld.Part1 = HeadHitbox
end)
end)
if I put the players head manually in weld.Part0 then it works but it doesnt work in the script