when i say clean up it don't work. can someone help me to fix it as i need to work for my tycoon as it all ways flooding with bricks.
function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name)
msg = string.lower(msg)
--------------------------------------command between these bits--------------------------------------
if (msg == "clean up") then
cf = game.Workspace:GetChildren()
for i = 1, #cf do
if cf[i].Name == "TycoonBrick" then
cf[i]:remove()
elseif cf[i].Name == "UpgradedTycoonBrick" then
cf[i]:remove()
elseif cf[i].Name == "BestTycoonBrick" then
cf[i]:remove()
end
end
end
--------------------------------------command between these bits--------------------------------------
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered)

2 comments
thanks it help me out a lot
My pleasure!