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

Can Someone help me to fix this regen script?

the meg will not go way

enabled = true

--clon = script.Parent.Parent:FindFirstChild("Regen Pack"):Clone()
--clon.Parent = game.Lighting
--clon.Name = script.Parent:FindFirstChild("Bus Name").Value

function touch(part)
	if enabled then
		if (part.Parent:FindFirstChild("Humanoid") ~= nil) then
			enabled = false
			name = part.Parent.Name
			busname = script.Parent:FindFirstChild("Bus Name").Value
			bus = game.Lighting:FindFirstChild(busname)
			m = Instance.new("Message")
			m.Text = "A New " .. busname .. " is Being Spawned By " .. name
			m.Parent = game.Workspace
			regen = bus:Clone()
			regen.Parent = game.Workspace
			regen:makeJoints()
			wait(5)
			m:Remove()
			wait(20)
			enabled = true
		end
	end
end


script.Parent.Touched:connect(touch)

1 answer

You need to change m:Remove() to m:Destroy() The Remove() method is outdated. Use Destroy() to remove objects from the game. I hope this helped you and the regen script should work again without the message sitting there!

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