You should always Parent last after setting your Properties, the second parameter of Instance.new() is not recommended to use
Shoot.OnServerEvent:Connect(function(Player,MouseHit,Gun)
local Character = Player.Character --or Player.CharactedAdded:Wait() There's no need to wait for the Character to load
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
if Gun.Name == "Desert Eagle" then
local Bullet = Instance.new("Part")
Bullet.Size = Vector3.new(1,1,1)
Bullet.CFrame = Gun.Handle.CFrame
Bullet.Parent = workspace
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.Velocity = (MouseHit.LookVector*Vector3.new(math.random(-1.2,1.2),1,1)) * 1000 -- Randomness added in there to make the gun less accurate
BodyVelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
BodyVelocity.Parent = Bullet
local hitbox = Hitbox(Bullet)
hitbox.Touched:Connect(function(Hit)
if IsCharacter(Hit.Parent) and Hit.Parent.Name ~= Player.Name then
local Humanoid = Hit.Parent:WaitForChild("Humanoid")
if Hit.Name == "Head" then
Humanoid:TakeDamage(50)
else
Humanoid:TakeDamage(25)
end
end
end)
end
end)