I have been trying figure out what was wrong with my code for quite a long time now, and I still do not know why this one if statement will not work even though it is true.
Here is the code:
for place , frame in pairs(Winners) do
local Actualplace = string.split(place, "")[string.len(place)]
print(Actualplace)
for _, plr in pairs(game.Players:GetPlayers()) do
local MainFrame = ServerStorage.BindedFunc.WaitForGUISERVER:Invoke(plr)
if frame then
local Cframe = frame:Clone()
Cframe.Parent = MainFrame.Winners[Actualplace]
for Num, Pos in pairs(TweenLocationsToPlace) do
print(Num..Actualplace)
Actualplace = string.split(place, "")[string.len(place)]
if Actualplace == Num then
print("Playing?") --Does not print playing. This if statement does not run.
end
print(Num.." "..Actualplace) --print 3 3 , 2 2 , and 1 1 but the if statement still does not run.
end
end
end
end
Here is what the tables are equal to:
Winners :
local placesName = {
["player1"] = 1;
["player2"] = 2;
["player3"] = 3;
}
TweenLocationsToPlace :
[1] = UDim2.new(0.285,0,-0.12,0);
[2] = UDim2.new(0.011,0,1.5,0);
[3] = UDim2.new(0.56,0, 1.5,0)
Thanks for your help!