My script is supposed to make things inside a GUI active so that players can see if they won/lost the game.
The giving of XP works, but for some reason, the game won't access PlayerGui (Is it even possible to access in the first place?)
Everything is named correctly
Can someone please help me? Here's the script:
function EndGame()
local player = game.Players:getPlayers()
for i = 1, #player do
if player[i].TeamColor == BrickColor.new("Bright green") then
player[i].PlayerGui.EndGameGUI.Frame.Victory.Visible = true
player[i].Other.XP.Value = player[i].Other.XP.Value + 300
elseif player[i].TeamColor == BrickColor.new("Bright red") then
player[i].PlayerGui.EndGameGUI.Frame.Defeat.Visible = true
player[i].Other.XP.Value = player[i].Other.XP.Value + 150
end
end
end

2 comments
You never actually call the function.
The function occurs. I'm just posting a small section of the script. The function gives XP but does not do anything to the GUI in question