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

Short Loop Not Working?

Asked by 9 years ago
while true do
    local Child=script.Parent.Game.LeftLane:GetChildren()
if  Child.YScale< Child then
    Child.Name="Left1"
end
end

19:44:25.117 - Players.Player.PlayerGui.LocalPricklyMagpie:66: attempt to compare nil with table

Hierarchy: game>Players>PlayerGui>Game(ScreenGui)>LeftLane

--Will this work [edit]
children = script.Parent.Game.LeftLane:GetChildren()
for k, child in pairs(children)do
if child:IsA('ImageLabel') and 
    child.Name=="Left" and
    child.YScale<=children then
child.Name="Test"
end 
end


I'm trying to make a script that constantly checks if a Frame's YScale is lower than other the other Frames with the same exact name inside "LeftLane" . After the code finds that one, it will rename it so it can function with my DDR script.

1
I'm a bit confused. You're trying to get the children of Child, check their Y scale and compare it? Shawnyg 4330 — 9y
0
I'm trying to get the Children of LeftLane. They all have the same name. After getting the children I want to compare all of their YScale values and the one that has the lowest one will receive a name change. SamDomino 65 — 9y
0
YScale isn't a property of the table Child. :GetChildren() method is a table. Tkdriverx 514 — 9y
1
The code required to achieve what you're trying to do is MUCH longer than what you are already doing. Tkdriverx 514 — 9y
0
can you explain the components needed so I can google them on the roblox wiki? SamDomino 65 — 9y

Answer this question