local ChatGui = game.Players:WaitForChild("DevSeveral").PlayerGui local Part = script.Parent local Blackoutthingy = game.Workspace.Black1:GetDescendants() Part.ClickDetector.MouseClick:Connect(function(pussy2) Part.BrickColor = BrickColor.new("Bright yellow") Part.Anchored = true Part.Transparency = .2 wait(2) ChatGui:Destroy() wait(2) if Part.BrickColor == BrickColor.new("Bright yellow") then print('Part is bright yellow') wait(.01) print('Changing...') Part.BrickColor = BrickColor.new("Alder") wait(2) Part.BrickColor = BrickColor.new("White") print('BLACKOUT INCOMING!') wait(3) Blackoutthingy.transparency = 0 Blackoutthingy.Cancollide = true print('Blackout will end in 5 seconds') wait(5) Blackoutthingy.transparency = 0 Blackoutthingy.Cancollide = true print('Blackout ended') print('DEV ONLY INFO: ',Blackoutthingy) end end)
Errors: none
I want the parts that are the children of Black1 to cancollide be true and for transparency go to 0 at line 20, And then go back to transparency 1 and cancollide false also, why does it print this 'function: 0x0de61314625aab51 table: 0x6a71a87bcce0e3a1' at the end instead of what I want it to print?
You can't print tables. If you want to print all the contents inside the table then do this:
for i,v in pairs(Blackoutthingy) do print(v.Name) end
To make all for the descendants of black out thingy change you would use a for loop you can read about that here Loops
local DevInfo = "DEV INFO ONLY: " for i, Descendant in pairs(Blackoutthingy) do if Descendant.ClassName == "Part"--to check if its a part if Descendant.BrickColor == BrickColor.new("Bright yellow") then print('Part is bright yellow') print('Changing...') Descendant.BrickColor = BrickColor.new("Alder") Descendant.BrickColor = BrickColor.new("White") print('BLACKOUT INCOMING!') Descendant.transparency = 0 Descendant.Cancollide = true print('Blackout will end in 5 seconds') Descendant.Transparency = 0 Descendant.Cancollide = true print('Blackout ended') print('DEV ONLY INFO: ', Descendant.Name) --if you only wanted to print the name --if u wanted to add it to a list DevInfo = (DevInfo.." "..Decscendant.Name..","')--adds to list with each loop end print(DevInfo)--this would print the full list end
hope this is helpful to you