Hey, me again... I have a GUI in which players can press spectate to not play the next minigame. The problem is, this has its own script and the script below is in my minigame script.
I need to set up a boolean to check if the player is spectating or not, and if they are they won't earn points as stated below. But if I use a global variable, surely all players would be classed as spectating if one player presses the button.
Basically for this script to read my other one in the GUI I would have to use a global variable, and if I do every time one person presses the button and changes that global variable, it will change for everyone.
for i,v in pairs(game.Players:GetPlayers()) do isplaying = v:FindFirstChild("IsPlaying") if (isplaying) then if (isplaying.Value == true) then v.leaderstats.Points.Value = v.leaderstats.Points.Value + reward end end end