Decest
|
  |
| Joined: 13 Dec 2012 |
| Total Posts: 5 |
|
|
| 27 Dec 2012 08:16 PM |
This is a cleanup script, but because I'm using blobbyblob's denoobified building tools I don't know how to correctly change the clean up script. Blobby's tools change the name of the bricks to BlobbyblobBuild_ + whatever the username is of the user who copied that brick. ("BlobbyblobBuild_"..player.Name)
This is the clean up script, how do I have to change it so it would clean up the bricks that start with BlobbyblobBuild_ ?
voted = {} function getVoted(name) if voted == {} then return false end for i=1,#voted do if voted[i] == name then return true end end return false end
function onChatted(msg, recipient, speaker) source = speaker.Name msg = string.lower(msg)
if ((msg == "cleanup") or (msg == "vote cleanup")) then if getVoted(source) == false then table.insert(voted, source) if #voted > (game.Players.NumPlayers * 0.7) then local bricks = game.Workspace:getChildren() for i=1,#bricks do if (bricks[i].Name == "block") then bricks[i]:remove() end end voted = {} end end end end
function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end
game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 27 Dec 2012 08:19 PM |
Change: if (bricks[i].Name == "block") then to: if (string.sub(bricks[i].Name, 1, 16) == "BlobbyblobBuild_") then |
|
|
| Report Abuse |
|
Decest
|
  |
| Joined: 13 Dec 2012 |
| Total Posts: 5 |
|
|
| 27 Dec 2012 08:26 PM |
| Thank you so much for your help! It works. :) |
|
|
| Report Abuse |
|