local character = workspace["Gem Monster"] character:WaitForChild("Humanoid").Died:connect(function() --waitforchild to make sure its there redgem = Instance.new("Part",game.Workspace.GemDropStorage) redgem.Size = Vector3.new(1,1,1) redgem.Material = "Neon" redgem.BrickColor = BrickColor.new("Really red") end)
When you kill the monster, it spanws a red part, which it is supposed to do then it respawns How do i edit the script to make it so i can kill it multiple times and every time it drops a brick
Well lets say that all of our monsters are located inside a folder or model we will make it so that whenever a new monster is added to that folder it will make it so that if it dies it will fire this
First we will add a childadded event
local folder=workspace.Monsters folder.ChildAdded:connect(function(child) end)
Next to add that died event function
local folder=workspace.Monsters folder.ChildAdded:connect(function(child) child:WaitForChild("Humanoid").Died:connect(function() redgem = Instance.new("Part",game.Workspace.GemDropStorage) redgem.Size = Vector3.new(1,1,1) redgem.Material = "Neon" redgem.BrickColor = BrickColor.new("Really red") end) end)