I want only players in a private server to have a ScreenGUI enabled.
I dont know how to do that, so can anybody help?
2 Likes
Try this:
local Players = game:GetService("Players")
-- is this a VIP server?
if game.PrivateServerId ~= "" and game.PrivateServerOwnerId ~= 0 then
-- listen for new players being added
Players.PlayerAdded:Connect(function(player)
-- check if the player is the server owner
if player.UserId == game.PrivateServerOwnerId then
-- put here your gui
game.ServerStorage.VIPGui:Clone().Parent = player.PlayerGui -- set the gui Reset to false
end
end)
end
7 Likes