This is my basic script. (I know the false and true should be switched. I was just testing if it worked.) It's still showing up to me, though, and I'm in that group..
if (player:IsInGroup(3491785) == true) then game.StarterGui.StatsBar.Visible = false else game.StarterGui.StatsBar.Visible = true end
Once the game starts running, starter gui clones everything to the players playergui, so thats why its not working. Try using this:
lua
if (player:IsInGroup(3491785) == true) then
game.PlayerGui.StatsBar.Visible = false
else
game.PlayerGui.StatsBar.Visible = true
end
I think it's the true that's affecting it
Try this
if player:IsInGroup(3491785) then
We'll change
if (player:IsInGroup(3491785) == true) then game.StarterGui.StatsBar.Visible = false else game.StarterGui.StatsBar.Visible = true end
To
local Player = game:GetService("Players").LocalPlayer if Player:IsInGroup(3491785) then Player.PlayerGui.StatsBar.Visible = false else Player.PlayerGui.StatsBar.Visible = true end
Basically you're not correctly defining stuff like the player and you're changing the StarterGui which doesn't update to the player live.