Hello, I’m back again with a scripting problem.
local Players = game:GetService("Players")
local Assign = game.Workspace:WaitForChild("AssignPersonalities")
local Personalitiess = game.Workspace:WaitForChild("Personalities")
if Personalitiess then
local Personalities = game.Workspace.Personalities:GetChildren()
local AppliedDummies = game.Workspace.AppliedDummies:GetChildren()
if Assign then
if #Players:GetPlayers() == 2 then
local random_P1 = Personalities[math.random(1,#Personalities)]
local random_D1 = AppliedDummies[math.random(1,#AppliedDummies)]
random_P1.Parent = random_D1
random_D1.Parent = game.Workspace.ChosenDummies
random_P1.Humanoid:MoveTo(random_D1.HumanoidRoot.Position + Vector3.new(0,0,-2))
end
This script gives the error “Bad argument #2 (interval is empty)” at line 11 (I’m guessing 12 too.)
game.Workspace.Personalities:GetChildren() should be greater than 1 since it’s the amount of players and there must be 2 players for this to run. (“Personalities” too).
I’m new to scripting so, sorry if it’s a silly mistake.
Disclaimer: “AppliedDummies” and “Personalities” are folders in case that makes a difference.
