So I wrote out this code, but for some reason it won't work.
game.Players.PlayerAdded:Connect(function() local Player = game.Players.LocalPlayer if Player:IsInGroup(4324101) then Player.PlayerGui.Spawn.Enabled = true end end)
Any ideas as to why? The script is a local script and no output errors.
You do not necessarily need the PlayerAdded event here at all. Since you are using a local script to check whether the LocalPlayer is in a group, you can simply do just that:
local player = game.Players.LocalPlayer if player:IsInGroup(4324101) then player.PlayerGui.Spawn.Enabled = true end
The issue with your current set up is that the PlayerAdded event may not fire after the local script is placed properly. Additionally, the function passed in Connect will also be called every time a new player joins, which may not be desirable.