why doesen't the for loop work but the rest of the script does?
Asked by
5 years ago Edited 5 years ago
so in the script in the script i did this, it printed gamestart but didn't print yes, the rest of the script works just that this for loop doesn't work
004 | for _,i in pairs (game.Players:GetPlayers()) do |
006 | if i.CanPlay.Value = = true then |
013 | local Number = Instance.new( "IntValue" ) |
015 | Number.Name = ( "PlateNumber" ) |
019 | for _,o in pairs (game.Workspace:GetChildren()) do |
020 | print ( "getting character" ) |
021 | if o.Name = = i.Name then |
022 | print ( "got character" ) |
024 | o.HumanoidRootPart.CFrame = CFrame.new(BP 1. X,BP 1. Y+ 4 ,BP 1. Z) |
025 | Base = game.Workspace.original:Clone() |
026 | Base.Parent = workspace |
027 | Base.Name = "BasePlate" |
029 | Base.CFrame = CFrame.new(BP 1. X,BP 1. Y,BP 1. Z) |
032 | o.HumanoidRootPart.CFrame = CFrame.new(BP 2. X,BP 2. Y+ 4 ,BP 2. Z) |
033 | Base = game.Workspace.original:Clone() |
034 | Base.Parent = workspace |
035 | Base.Name = "BasePlate" |
037 | Base.CFrame = CFrame.new(BP 2. X,BP 2. Y,BP 2. Z) |
040 | o.HumanoidRootPart.CFrame = CFrame.new(BP 3. X,BP 3. Y+ 4 ,BP 3. Z) |
041 | Base = game.Workspace.original:Clone() |
042 | Base.Parent = workspace |
043 | Base.Name = "BasePlate" |
045 | Base.CFrame = CFrame.new(BP 3. X,BP 3. Y,BP 3. Z) |
048 | o.HumanoidRootPart.CFrame = CFrame.new(BP 4. X,BP 4. Y+ 4 ,BP 4. Z) |
049 | Base = game.Workspace.original:Clone() |
050 | Base.Parent = workspace |
051 | Base.Name = "BasePlate" |
053 | Base.CFrame = CFrame.new(BP 4. X,BP 4. Y,BP 4. Z) |
056 | o.HumanoidRootPart.CFrame = CFrame.new(BP 5. X,BP 5. Y+ 4 ,BP 5. Z) |
057 | Base = game.Workspace.original:Clone() |
058 | Base.Parent = workspace |
059 | Base.Name = "BasePlate" |
061 | Base.CFrame = CFrame.new(BP 5. X,BP 5. Y,BP 5. Z) |
064 | o.HumanoidRootPart.CFrame = CFrame.new(BP 6. X,BP 6. Y+ 4 ,BP 6. Z) |
065 | Base = game.Workspace.original:Clone() |
066 | Base.Parent = workspace |
067 | Base.Name = "BasePlate" |
069 | Base.CFrame = CFrame.new(BP 6. X,BP 6. Y,BP 6. Z) |
072 | o.HumanoidRootPart.CFrame = CFrame.new(BP 7. X,BP 7. Y+ 4 ,BP 7. Z) |
073 | Base = game.Workspace.original:Clone() |
074 | Base.Parent = workspace |
075 | Base.Name = "BasePlate" |
077 | Base.CFrame = CFrame.new(BP 7. X,BP 7. Y,BP 7. Z) |
080 | o.HumanoidRootPart.CFrame = CFrame.new(BP 8. X,BP 8. Y+ 4 ,BP 8. Z) |
081 | Base = game.Workspace.original:Clone() |
082 | Base.Parent = workspace |
083 | Base.Name = "BasePlate" |
085 | Base.CFrame = CFrame.new(BP 8. X,BP 8. Y,BP 8. Z) |
093 | for _,i in pairs (game.Workspace:GetChildren()) do |
094 | print ( "getting BasePlate" ) |
095 | if i.Name = = "BasePlate" then |
096 | print ( "got BasePlate" ) |
100 | for _,i in pairs (game.Players:GetChildren()) do |
101 | print ( "getting players 2" ) |
102 | if i.CanPlay.Value = = true then |
104 | for _,e in pairs (game.Workspace:GetChildren()) do |
105 | print ( "getting character 2" ) |
106 | if e.Name = = i.Name then |
107 | print ( "got character 2" ) |
108 | e.HumanoidRootPart.CFrame = CFrame.new( 500 , 4 , 500 ) |
111 | for _,o in pairs (i:GetChildren()) do |
112 | print ( "getting platenumber" ) |
113 | if o.Name = = "PlateNumber" then |
114 | print ( "destroying patenumber" ) |
it outputs:
5 | getting character 2 (x 14 ) |
7 | getting platenumber (x 6 ) |