Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Doesn't work in filtering enabled help?

Asked by 5 years ago

****Script is in ServerScriptService and its a Script of course

game.Players.PlayerAdded:connect(function(plr)
    local saves = plr:WaitForChild("saves")
    local CitValue = saves:WaitForChild("Citizens")

    wait()
    for i=CitValue.Value,1, -1 do
        local citizens = game.ReplicatedStorage.Spawnables.Citizen:Clone()
        for i,aa in pairs(citizens:GetChildren()) do
            if aa:IsA("Part") then
                local owner = citizens.Owner
                citizens.Owner.Value = plr.Name
                citizens.Parent = game.workspace:WaitForChild("CitizenHolder")
                citizens:moveTo(game.Workspace.CitizenHolder.SpawnCloud.Position)
            end
        end
    end
end)

Answer this question