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

How Do You Make A Collection Service Dance Floor With Tables?

Asked by 3 years ago
Edited 3 years ago

Basically I Want To Add A Dance Floor With Collection Service But I Tried And Failed

How Would I Do It?

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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.

0
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 45 — 3y
0
@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. MarkedTomato 810 — 3y
Ad

Answer this question