thanks, but idk exactly how i can use it. Im really new at scripting, can you send me the working script maybe with explainings?
Okay, give this a go. Not sure if it will work straight away though.
local Players = game:GetService("Players")
local WS = game:GetService("Workspace")
--Getting Objects that hold the surface GUI's
local TextOneObject = WS:WaitForChild("Text1")
local TextTwoObject = WS:WaitForChild("Text2")
--Getting the Surface GUI Text
local TextOne = TextOneObject.SurfaceGui.Text
local TextTwo = TextTwoObject.SurfaceGui.Text
function CheckPlayersInServer()
local playersInServer = Players:GetChildren() --Gets Players in server
--Resets Objects Transparency
TextOne.BackgroundTransparency = 1
TextOne.BackgroundTransparency = 1
--Changes Object and Gui Properties based on player count
if #playersInServer >= 2 then
TextOneObject.Transparency = 1 --May Need Changing for your purpose
TextOneObject.CanCollide = false --May Need Changing for your purpose
TextOne.TextTransparency = 1 --May Need Changing for your purpose
TextOne.TextTransparency = 0 --May Need Changing for your purpose
else
TextOne.TextTransparency = 0 --May Need Changing for your purpose
TextOne.TextTransparency = 1 --May Need Changing for your purpose
TextOneObject.Transparency = 0 --May Need Changing for your purpose
TextOneObject.CanCollide = true --May Need Changing for your purpose
end
end
Players.PlayerAdded:Connect(function(player) --When a player Joins
CheckPlayersInServer() --Runs the Check Function
end)
Players.PlayerRemoving:Connect(function(player) --When a player Leaves
CheckPlayersInServer() --Runs the Check Function
end)
no its not working too dffd
What’s not working?. Does it throw an error or is it just not functioning correctly? in which case is one of the objects disappearing and not the other?
its now working i did a spelling mistake.
Awesome
Good Luck with your project , enjoy your day.
tysm. erdrerreererrerererererre