generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How to make this working?

Previous Thread :: Next Thread 
Decest is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image