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

I made a Gui that appears/disappears depending on the team you are: not working?

Asked by
Tabrix 2
4 years ago

Hi, its the first time im posting here.

local Players = game:GetService("Players")
local frame = script.Parent
local CameraPlayer = game.Players.LocalPlayer

game:GetService("Teams").Ingame.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function()
        if player.Name == CameraPlayer.Name then
            frame.Visible = false
            CameraPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
            return
        end
    end)
end)

game:GetService("Teams").Lobby.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function()
        if player.Name == CameraPlayer.Name then
            frame.Visible = true
            CameraPlayer.CameraMode = Enum.CameraMode.Classic
            return
        end
    end)
end)

so when the team is assigned the gui is not going visible / not visible this is made on a localscript i debugged a bit and all looks correct (know that camera player stuff are working)

0
Manipulating GUIs require a localscript. Are you using it? Dovydas1118 1495 — 4y
0
its written... 'this is made on a localscript' Tabrix 2 — 4y
0
Are you trying to set their team at the start of the game, or between rounds? Nckripted 580 — 4y
0
between rounds Tabrix 2 — 4y

Answer this question