So I have a script that is supposed to make a folder's parent the workspace if the player count is less than 2. In the folder, there are 4 bots that follow the player and attack them. here's the script.
players = game.Players:GetChildren() if #players >= 2 then game.ReplicatedStorage.Bots.Parent.new = workspace end
the problem is that nothing actually happens. can someone please fix the script?
You don't need the .new
game.ReplicatedStorage.Bots.Parent = game.Workspace
If you need to create a copy of the item, use :Clone()
and set the parent of the copy:
game.ReplicatedStorage.Bots:Clone().Parent = game.Workspace