I want to weld a m1 hitbox to the Player but i get an error saying "Position cannot be assigned to" the script is in ServerScriptService Btw
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Wait() wait() local Hitbox = game.ReplicatedStorage.Hitbox:Clone() local Weld = Instance.new("Weld") Weld.Part0 = Hitbox Weld.Part1 = player.Character.HumanoidRootPart Weld.Parent = Hitbox Weld.C0.Position. = Vector3.new(0, 0, 3.5) Hitbox.Parent = player.Character end)
Change the C0
instead.
local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local Hitbox = ReplicatedStorage.Hitbox Players.PlayerAdded:Connect(function(player) local character = player.Character if (character == nil) or (character.Parent == nil) then character = player.CharacterAdded:Wait() end local Hitbox = Hitbox:Clone() Hitbox.Parent = character local Weld = Instance.new("Weld") Weld.Parent = Hitbox Weld.Part0 = Hitbox Weld.Part1 = character.HumanoidRootPart Weld.C0 = CFrame.new(0, 0, 3.5) -- basically Vector3.new(0, 0, 3.5) end)