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

How to make a script that cleans the game?

Asked by 8 years ago

How to make a script that gets rid of any hats or gear or vehicles that aren't being used?

1 answer

Log in to vote
0
Answered by 8 years ago

Although I am not sure how to clean vehicles, I can help you with cleaning hats and tools. That's generally easy to do.

while true do
    wait(10)
    for i, v in pairs(game.Workspace:GetChildren()) do
        if v:IsA("Hat") or v:IsA("Tool")
            then v:Destroy()
        end
    print("Place cleaned.")
    end
end 

The script scans the game for any hats or tools, and if it is found, it is deleted. It does this every 10 seconds, but you can change the interval by editing the number next to the wait() function (Line 2). The print command (Line 7) is optional but very useful for testing it.

Ad

Answer this question