#humanoid not spawning properly

19 messages · Page 1 of 1 (latest)

lament nexus
#

when i spawn my humanoid in my tower defense game, one part only appeared.
the rest were gone

lament nexus
#

function mob.Spawn(name,quantity,map)
local mobExists = ServerStorage.Mobs:FindFirstChild(name)

if mobExists then
    for i=1,quantity do
        task.wait(0.5)
        local newMob = mobExists:Clone()
        newMob.HumanoidRootPart.CFrame = map.Start.CFrame
        newMob.Parent = workspace.Mobs
        newMob.HumanoidRootPart:SetNetworkOwner(nil)

        for i, object in ipairs(newMob:GetDescendants()) do
            if object:IsA("BasePart") then
                PhysicsService:SetPartCollisionGroup(object,"Mob")
            end
        end
        if newMob:FindFirstChild("Animations"):FindFirstChild("hold") then
            animateTower:FireAllClients(newMob,"hold")
        end
        newMob.Humanoid.Died:Connect(function()
            if newMob.Config:FindFirstChild("deathSound") then
                newMob:Destroy()
                return
            end
            --ServerStorage.sounds.normaldeath:Clone().Parent = newMob 
            newMob:Destroy()
        end)

        coroutine.wrap(mob.move)(newMob,map)
    end
else
    warn("Requested mob does not exist:",name)
end

end

#

script btw

#

the mob file is in server storage

olive carbon
#

Instead of changing HumanoidRootPart.CFrame

#

Try using newMob:PivotTo(map.Start.CFrame)

lament nexus
#

ok ill try

#

@olive carbon which line tho

#

newMob.HumanoidRootPart.CFrame = map.Start.CFrame

#

nvm

olive carbon
lament nexus
#

doenst seem to work

#

it doesnt spawn one anymore

olive carbon
#

is your mob a model?

delicate pike
#

studio** You are now Level 1! **studio

olive carbon
#

newMob instance

lament nexus
#

with wieldds

#

wields