Basically I Want To Add A Dance Floor With Collection Service But I Tried And Failed
How Would I Do It?
Basically I Want To Add A Dance Floor With Collection Service But I Tried And Failed
How Would I Do It?
I've Inserted 81 Parts and size them to be 4,1,4(X, Y, Z) and named them 'DanceFloorTiles' in the 'Workspace'.
Next, you want to use this plugin called 'Tag Editor'. Here's a link to it: https://www.roblox.com/library/948084095/Tag-Editor
After you installed it do the following: Open up your 'Tag Editor' plugin in the 'PLUGINS' tab and then you'll see 'Add new tag...' click on it and name it to 'DanceFloor' and press enter.
Now you want to select all of your 'DanceFloorTiles' in the workspace and check the box that appears next to the 'DanceFloor' tag in the 'Tag Editor'.
So, now you wanna insert a 'Script' in 'ServerScriptService' and paste the following code into the script.
Here:
local CollectionService = game:GetService("CollectionService")
local BETWEEN_EACH = 2.5
--You can put more 'BrickColors' in the 'Colors' table. I've put 11 'BrickColors' in the 'Colors' table you can add as much as you want.
--Here's a page to all BrickColor codes:
--https://developer.roblox.com/en-us/articles/BrickColor-Codes
local Colors = {"Bright red", "Bright blue", "Bright yellow", "Medium red", "Medium blue", "Hot pink", "Deep blue", "Sunrise", "Baby blue", "Neon orange", "Sea green"}
local function RandomBrickColor(part)
local brickColors = Colors[math.random(1,#Colors)]
part.BrickColor = BrickColor.new(brickColors)
end
while true do
for INDEX, DanceFloorTiles in pairs(CollectionService:GetTagged("DanceFloor")) do
RandomBrickColor(DanceFloorTiles)
end
wait(BETWEEN_EACH)
end
If this works, make this the solution.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Could You Make A Table For The Colors? I Don't Want Dark Colors Like Black Or Dark Green. Last Time I Tried It It Only Did Green, White And Yellow.
@Brioche_Noodle I've changed the script. Find the BrickColors you like at: https://developer.roblox.com/en-us/articles/BrickColor-Codes. Make sure to put the name of the BrickColors in string values.