Hello! My goal is pretty straightforward, id like for the table to print to the server when there is 1 player in each team but to some unknown reason it isnt working!
If you could help me that would be nice! my scripting skills arent that great.
Its inside a function if anyone is wondering.
while true do
local Htable = Hteam:GetPlayers()
local Stable = Steam:GetPlayers()
if #Htable == 1 and #Stable == 1 then
print("Works")
end
end
end
There is not a task.wait() (or anything else like that) within your while true loop, do you think this may be the cause? You’re most likely getting the error: Script timeout: exhausted allowed execution time
while true do
task.wait( 0.5 ) -- Now has a wait.
local Htable = Hteam:GetPlayers()
local Stable = Steam:GetPlayers()
if #Htable == 1 and #Stable == 1 then
print("Works")
end
end
It’s not my code and not my system. I offerred them the solution to their problem and no additional help is needed. I’m sure they’re capable of scripting their own break statement (if applicable), if not they can make another forum post lol.
The code should work. As long as you change the players’ teams on the server (with a Script) and there isn’t any code underneath the while loop in the same scope.