For some reason if I print v.Name it will print row used while I checked if v is a plate but the row used child still goes true “in the scipt part you can see where I printed I marked it!”, please help me!
This is the script!
local platesFolder = game.Workspace:WaitForChild("PlatesFolder")
for i, val in pairs(workspace.PlatesFolder:GetChildren()) do
for i, v in pairs(val:GetChildren()) do
if v.Name == "Plate" then
v.Touched:Connect(function(otherPart)
if otherPart.Parent:FindFirstChild("Humanoid") then
if v.Parent.RowUsed.Value == false then
v.Parent.RowUsed.Value = true
local newRow = v.Parent.Row.Value + 1
local row = platesFolder:FindFirstChild("Row"..tostring(newRow))
local randomNumber = math.random(1,3)
if randomNumber == 1 then
local line = v.Line.Value
local lineToMakeSave = line - 1
if lineToMakeSave < 1 then
for i,v in pairs(row:GetChildren()) do
if v.Line.Value == line then
v.Kill.Value = false
end
end
else
for i,v in pairs(row:GetChildren()) do
if v.Line.Value == lineToMakeSave then
v.Kill.Value = false
end
end
end
elseif randomNumber == 2 then
local line = v.Line.Value
for i,v in pairs(row:GetChildren()) do
print(v.Name) ----------------right here is the mark
if v.Line.Value == line then
v.Kill.Value = false
end
end
elseif randomNumber == 3 then
local line = v.Line.Value
local lineToMakeSave = line + 1
if lineToMakeSave > 4 then
for i,v in pairs(row:GetChildren()) do
if v.Line.Value == line then
v.Kill.Value = false
end
end
else
for i,v in pairs(row:GetChildren()) do
if v.Line.Value == lineToMakeSave then
v.Kill.Value = false
end
end
end
end
end
end
end)
end
end
end
heres the workspace and error