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

How do I prevent this NPC regen from freezing the game?

Asked by
Xl5Xl5 65
9 years ago

How can I prevent the game from freezing just before the NPC respawns?

Instead of it just cloning itself all the time and backing it up, would it be wise for it clone from lighting? Anyway here is the script that is inside the NPC

The top part of the code (function Respawn) is whats making NPC freezing the game before respawn. Also Output says nothing about this

Thanks!

001local Model = script.Parent
002Model:MakeJoints()
003wait()
004Model:MakeJoints()
005local Backup = Model:clone()
006Backup:MakeJoints()
007wait()
008Backup:MakeJoints()
009 
010function Respawn()
011    Model:breakJoints()
012    script.Parent = Model.Parent
013    wait(5)
014    if (Model ~= nil) then
015        Model:Destroy()
View all 431 lines...
0
You need a wait in the for loop that you start on line 28 and also I have no idea what you're doing with that "delay(0.," part FearMeIAmLag 1161 — 9y

Answer this question