Have you looked in the explorer while testing? See that it actually ends up there?
Have you tried waiting like 10 seconds and then printing all children of camera?
The most likely issue is that it’s not detecting that as a child. Whether it be a spelling mistake or some issue with the logic that puts it in the camera.
Ohh… Are you cloning from a local script? If you are then the server can’t see them. If you made it in a local script, only a local script can do anything with them (since it only exists for that player). So the server script you wrote won’t be able to access it.
Oh thanks, do you think you can show me how to do that exactly. I’m not very good at scripting and am just starting out. And too answer your question yes, it is cloning from a local script.
Actually easiest solution since what you are checking for on the server is possible to do on the client is to just make the following a local script
local Block = game.Workspace.Camera.Block
local Rain = game.Workspace.Camera.Rain
local CloudPiece1 = game.Workspace.Camera.Cloud.CloudPiece1
local CloudPiece2 = game.Workspace.Camera.Cloud.CloudPiece2
local CloudPiece3 = game.Workspace.Camera.Cloud.CloudPiece3
game.Players.LocalPlayer.Chatted:Connect(function(message)
if message == "/e hello" then
Block:Destroy()
Rain:Destroy()
CloudPiece1.BrickColor = BrickColor.new("Pearl")
CloudPiece2.BrickColor = BrickColor.new("Pearl")
CloudPiece3.BrickColor = BrickColor.new("Pearl")
end
end)
I forgot the waitForChilds. I am lazy though and instead of typing that a lot I would just move all those variables into the if statement since by the time that code runs it should all be there anyways. (and if it errors, it won’t break the whole script)
It’s also worth noting that since you are using those variables only once, you might as well just use them in the line they are affecting. Usually when you set a variable like that it’s to simplify the path so you don’t have to type a long string over and over again. Or it’s to make something more readable. In my opinion this way is just as readable, but not everyone would agree.
game.Players.LocalPlayer.Chatted:Connect(function(message)
if message == "/e hello" then
game.Workspace.Camera.Block:Destroy()
game.Workspace.Camera.Rain:Destroy()
game.Workspace.Camera.Cloud.CloudPiece1.BrickColor = BrickColor.new("Pearl")
game.Workspace.Camera.Cloud.CloudPiece2.BrickColor = BrickColor.new("Pearl")
game.Workspace.Camera.Cloud.CloudPiece3.BrickColor = BrickColor.new("Pearl")
end
end)
Actually a good example of what I think is a good use of that variable would be this
game.Players.LocalPlayer.Chatted:Connect(function(message)
if message == "/e hello" then
local camera = game.Workspace.Camera
local cloud = camera.Cloud
camera.Block:Destroy()
camera.Rain:Destroy()
cloud.CloudPiece1.BrickColor = BrickColor.new("Pearl")
cloud.CloudPiece2.BrickColor = BrickColor.new("Pearl")
cloud.CloudPiece3.BrickColor = BrickColor.new("Pearl")
end
end)
What I’ve said only applies if you have cloning done in a local script already. If it’s not already in a local script then this won’t work. The script I supplied should just be added either to the end of the cloning script, or as a separate local script.