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

code wont run if statements at all?

Asked by 5 years ago

code:

wait(1)
local teams = game:GetService("Teams"):GetTeams()
local text = script.intermission.SurfaceGui.Frame.TextLabel
local players = game.Teams
print(#players)
if #players.Playing:GetPlayers() == 0 then
        text.Text = 'intermission'
        print('round in progress')
    else
        text.Text = 'round in progress'
        print('round in progress')
end

I test the game and it won't print anything, nor will it change the text.

0
You're checking under the player variable for Teams not players. So you will only get a list of teams. And you should aso try using "For i,v in pairs([teams variable])" IrishStukov 20 — 5y
0
Where abouts is your script located? I know that if a script is put in some places it won't run. I can't remember exactly where these places are, but try moving your script around to see if that fixes the issue. DaR3ka 0 — 5y
0
its in workspace SodaZere 31 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

To be honest your code is all wrong lol

tell me what you're trying to do and I'll have it fixed asap

Also don't down vote this I will give him serious help

0
when theres 0 players on the playing team it will change the text on the sign. when theres more than 0 players on the playing team then it will change the text on the sign to something different SodaZere 31 — 5y
Ad

Answer this question