Okay so I’m legit trying to hire people for 40 USD to exactly recreate club insanity/Club sanity’s dancefloor and everyone keeps renaming parts, or not making it look smooth or using parts and I want everything just like how it is in this picture regardless.
So how would I do the sliding function that club insanity/club sanity had where the dancefloor like slides by in rows changing the white to the color and so on then goes back here’s examples.
They probably just had a Sequence of Data for the Code to loop through, Applied it to the Parts under a specific order, and then Made it Disapear using Interpolation, or commonly known as Lerp.
If not then its most likely using a for loop and changing the Transparency based on Incrementation (However that is also how Lerp functions so ¯\_(ツ)_/¯ )
Every row of squares is parented inside a model, then a for loop goes through the models with a little delay (e.g. 0.1) and makes their Transparency 1. This is really easy to do.
They group all the parts in a row. Then they iterate like this:
for rowid = 1, #rows:GetChildren() do
local row = rows["Row"..rowid]
for _, part in pairs(row:GetChildren()) do
part.Color = currentColor -- set row color here
end
task.wait(0.05)
end
I happen to have a similar dancefloor. I found this within the code which creates a grid. You can copy that and turn y into rows and x into columns.
for y = 0, 9 do
for x = 0, 9 do
local s = slot:Clone() -- slot is just a frame
s.Position = UDim2.new(x * 0.1, 0, y * 0.1, 0)
s.Parent = squares
end
wait()
end
With this in mind we can use it to “reverse engineer” and figure out the opposite. They did 0, 9 which can be confusing so we’ll change it to 1, 10. I will also change the variable from ‘s’ to ‘Frame’.
local Slot = script:WaitForChild('Slot')
local MainFrame = script.Parent:WaitForChild('MainFrame')
for y = 1, 10 do -- Creates grid
for x = 1, 10 do
local Frame = Slot:Clone()
Frame.Position = UDim2.new(x * 0.1, 0, y * 0.1, 0)
Frame.Name = y .. "_" .. x
Frame.Parent = MainFrame
end
task.wait()
end
We named them so now we go something like 1_1, 1_2, 1_3, etc. Based off of y and x axis. Using this info we can then make a table.
local Slot = script:WaitForChild('Slot')
local MainFrame = script.Parent:WaitForChild('MainFrame')
local rows = {}
local columns = {}
for y = 1, 10 do
rows[y] = {}
for x = 1, 10 do
local Frame = Slot:Clone()
Frame.Position = UDim2.new(x * 0.1, 0, y * 0.1, 0)
Frame.Name = y .. "_" .. x
Frame.Parent = MainFrame
rows[y][x] = Frame
if not columns[x] then
columns[x] = {}
end
columns[x][y] = Frame
end
task.wait()
end
Now that you have the tables you SHOULD be able to make patterns with the following information. Hope this helps :>
I have a dancefloor of my own as well. Although I am not sure how to do the wave / slide effect. I had it semi-working but it didn’t like to do the effect in ‘reverse’ even though I scripted it to go either way. I have a lot to work on in my game. I hired a co-scripter so that’s cool. You can find videos on older versions of my dancefloor on my yt (my username) if you guys are curious.
Yeah it’s a bit tricky but all I did to get mine to do the sliding wave, was just name every tile in a row A# where # is the tile number in that row. (A1, A2, A3…) Then I do that for each row with the next letter. B1, B2, B3, etc. Then all I do it loop through the alphabet and get any tile starting with that letter. This worked well for me.
For that you’d need to use a coroutine, which allows you to have each row function on it’s own without delays.
This allows you to individually control the rows/columns.
for i,v in pairs(Rows) do
coroutine.wrap(function()
--the code for each row
for _,tile(v:GetChildren()) do
--do whatever with each tile. set the color, etc.
end
task.wait(0.5) --Or whatever you want
for _,tile(v:GetChildren()) do
--set the tile to black or off.
end
end)()
end
This will loop through each row, and control it separately from the other rows without causing the other rows to wait for the previous row’s function to finish.