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

Is it possible for me to get a team-change GUI off the toolbox?

Asked by 7 years ago

I've tried many times to make a team change GUI but I've failed each time. I'M GOING TO CRY.

0
Probably. Meltdown81 309 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Just make a button for how ever many teams you have and parent them to a screengui or frame within a screengui. Parent the localscript to the screengui/frame and place the following code:

local ply = game.Players.LocalPlayer
buttons = { }
teams = { }

for i, v in pairs(script.Parent:GetChildren()) do
    if v:IsA("TextButton") then
    table.insert(buttons,v)
    end
end

for i,v in pairs(game.Teams:GetChildren()) do
    table.insert(teams,v)
    buttons[i].Text = v.Name
end

while true do
for i,v in pairs(buttons) do
    v.MouseButton1Click:connect(function()
        ply.Team = teams[i]
    end)
end
wait(0.2)
end

Probably better ways to do this, but this is how I'd do it.

Ad

Answer this question