Im trying to color a cube into a Black. It works on a first cycle of clone but on the second cylce of cloning the script for color stop working.
---- Server Script
local Part = game. ServerStorage.Part
While true do
wait(1)
local Part_Clone = Part:Clone()
Part_Clone.Name = "Cube"
Part_Clone.Parent = game.Workspace
wait(10)
Part_Clone:Destroy()
end
---- Separate Server Script
local Cube =
game.Workspace:WaitForChild("Cube")
cube.BrickColor = BrickColor.new("Black")
If you want to do this just do it in one script like this:
function CubeColor()
for i, v in --[["Folder Name Here"]]:GetChildren() do
v.Color = Color3.FromRGB(0,0,0)
end
end
local Part = game. ServerStorage.Part
While true do
wait(1)
local Part_Clone = Part:Clone()
Part_Clone.Name = "Cube"
Part_Clone.Parent = game.Workspace.--{["Folder Name Here"]]
CubeColor()
wait(10)
Part_Clone:Destroy()
end
Why do you only want to change one random object, I don’t see the problem your facing at all.
If you just want to change the color of a single part that’s created and then destroyed then change the color directly in the script that creates that part.
local Part = game. ServerStorage.Part
While true do
wait(1)
local Part_Clone = Part:Clone()
Part_Clone.Name = "Cube"
Part_Clone.Parent = game.Workspace
Part_Clone.Color = Color3.FromRGB(0,0,0)
wait(10)
Part_Clone:Destroy()
end