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

Can Someone help me to fix this regen script?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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!

Ad

Answer this question