Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i make all npc's wait to respawn when all have died?

Asked by 5 years ago
Edited 5 years ago

Hello, ive been trying to make a script for that npc's will wait to respawn until all have died. This is what i have so far...

01while true do
02    human = script.Parent
03    clone = human:Clone()
04    human.Humanoid.Died:Wait()
05        if game.Workspace.Lives.Value <10 then
06            wait()
07        elseif game.Workspace.Lives.Value == 10 then
08        clone.Parent = game.Workspace
09        script.Parent = clone
10    script.Parent.Humanoid.Deaths.Value = script.Parent.Humanoid.Deaths.Value * 1.25
11    print(script.Parent.Humanoid.Deaths.Value)
12    script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.Deaths.Value * script.Parent.Humanoid.MaxHealth
13    script.Parent.Humanoid.Health = script.Parent.Humanoid.MaxHealth
14    game.Workspace.Lives.Value = game.Workspace.Lives.Value + 1
15    print(game.Workspace.Lives.Value)
16    human:Destroy()
17    end
18end
0
why did u clone human? the way to do it is u should first make alot of npcs then put them in a model and use TNTIsLyfe 152 — 5y
0
try for_, object in pairs(game.Workspace.(Npcmodel):GetChildren()) while true do if object.CanCollide = false then (Respawning the npcs) else wait() TNTIsLyfe 152 — 5y
0
i ment local object = object.UpperTorso if not object then this checks if the npc has died and his body parts are gone TNTIsLyfe 152 — 5y

Answer this question