I can't tell you why your script lags, it's mostly likely another reason, maybe you have connections that don't get GC'ed or maybe you have expensive functions running on the humanoid's death. Maybe it's the fact that you destroy the script's parent (and so does the script get destroyed) before parenting the mob to workspace.
I think it's better to use CollectionService coupled with Tiffany's Tag Viewer.
One way I would go about this using CollectionService is this way:
01 | local CollectionService = game:GetService( "CollectionService" ) |
03 | local mob = game:GetService( "ServerStorage" ).GrassMan |
07 | mob:Clone().Parent = workspace |
10 | for _,mob in pairs (CollectionService:GetTagged( "GrassPeople" )) do |
11 | connections [ mob ] = mob.Humanoid.Died:Connect( function () |
12 | if not mob then return end |
13 | mob:Destroy(); respawnMob(); connections [ mob ] :Disconnect() |
16 | CollectionService:GetInstanceAddedSignal( "GrassPeople" ):Connect( function (mob) |
17 | connections [ mob ] = mob.Humanoid.Died:Connect( function () |
18 | if not mob then return end |
19 | mob:Destroy(); respawnMob(); connections [ mob ] :Disconnect() |
22 | CollectionService:GetInstanceRemovedSignal( "GrassPeople" ):Connect( function (mob) |
23 | connections [ mob ] :Disconnect() |