What do you want to achieve? I want to make team menu that when the join button is pressed they will be assigned to that team
What is the issue? My script is simply not working, and there are no errors.
What solutions have you tried so far? Did you look for solutions on the Developer Hub? Yes, I did look for other solutions on the devhub, to which I found nothing that helped me with my situation. I’ve also tried looking for help in one of the roblox developer Discord Servers I was in. To which they didn’t know how to help me and told me to go here instead.
My script:
local teams = game.Teams
local devTeam = teams.Developer
local selecting = teams["Selecting Team"]
local joinButton = script.Parent
local player = game.Players.LocalPlayer
repeat wait() until game:IsLoaded(true)
joinButton.MouseButton1Up:Connect(function()
game:GetService('Teams'):GetTeams()
if player.Team == selecting then
player.Team = devTeam
end
end)
if player.Team == devTeam then
joinButton.Visible = false else
joinButton.Visible = true
end
(Note: I really don’t know what I’m doing I’ve never used a table with teams before)
local teams = game.Teams
local devTeam = teams.Developer
local selecting = teams["Selecting Team"]
local joinButton = script.Parent
local player = game.Players.LocalPlayer
repeat wait() until game:IsLoaded() == true
joinButton.MouseButton1Up:Connect(function()
game:GetService('Teams'):GetTeams()
if player.Team == selecting then
player.Team = devTeam
end
end)
if player.Team == devTeam then
joinButton.Visible = false else
joinButton.Visible = true
end
Nevermind I just fixed it, all I had to do was move it into the function and it works fine now.
local ts = game:GetService('TweenService')
local teams = game.Teams
local devTeam = teams.Developer
local selecting = teams["Selecting Team"]
local joinButton = script.Parent
local player = game.Players.LocalPlayer
local cam = game.Workspace.CurrentCamera
repeat wait() until game:IsLoaded(true)
joinButton.MouseButton1Up:Connect(function()
game:GetService('Teams'):GetTeams()
if player.Team == selecting then
player.Team = devTeam
if player.Team == devTeam then
joinButton.Visible = false else
joinButton.Visible = true
end
end
end)