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

Teams Name Help?

Asked by 8 years ago

Ok so here is my script

local teams = game.Teams
frame = game.StarterGui.Jobs.TeamMain
if teams.Name == "Teacher" then
    while true do
        frame.Visible = false
        wait(0.5)
    end
end

now I want it to check for the team name and if it is that name of the job as shown here Teacher it wont open the job chooser frame again even when the die?

0
Im pretty sure my problem here is that I dotn really have the name and Im declaring a folder im thinking about classnames perhaps johndeer2233 439 — 8y

1 answer

Log in to vote
0
Answered by
Decemus 141
8 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.

You are saying that the Service, 'Teams' has a name. In order to fix this do:

local teams = game.Teams
frame = game.StarterGui.Jobs.TeamMain
local b = teams:GetChildren()-- You have to grab all of the teams before checking for the name
for i=1,#b do -- A loop for the amount of teams
    if b.Name == "Teacher" then
    while wait(0.5) do -- If you would like to shorten it a bit, you can replace the 'true' with 'wait(0.5)'
    frame.Visible = false
    end
end
end


Ad

Answer this question