Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a humanoid respawn at a certain amount of time?

> The script is to respawn a model but I think a humanoid is a model so I used this script. So I want this script to respawn a humanoid every minute but it only multiplies the humanoid. I thought it was going to work at first but then when the humanoid respawned, 2 appeared and then after that there were 4 and then 8 and so on, so I couldn't use the script. I don't know how to fix the problem and also the message that appears when the humanoid respawns makes the game lag.

Edit: Ok Thanks, but these are the changes I made and it still won't work.

Here's the script:

local regenTime = 180 -- 3 minutes local messageTime = 2.5

local model = script.Parent local message = Instance.new("Message")

if model ~= workspace then message.Text = "" .. model.Name

local backup = game.Workspace:WaitForChild('model')


while true do 
	wait(regenTime) 

	
	model:Destroy()


	model = backup:clone() 
	model.Parent = game.Workspace 
	model:makeJoints()
end

1 comment

0

clone and makeJoints are deprecated switch to Clone and MakeJoints.

1 answer

It's because you are cloning eachother

'local backup = model:clone()' and 'model = backup:clone()', 

maybe try:

local backup = game.Workspace:WaitForChild('model')

This discussion is preserved as it was. New answers, comments, and votes are closed.