Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why won't my "not enough players" GUI stay hidden? [Solved]

I have a script that teleports players to a location when there enough, everything in the script works except for the gui transparency. I have my textlabel set to transparent and is should only be visible when there aren't enough players to teleport, as you can see I even tried to re-set the gui to transparent but it always shows up, why is this, I am getting no errors either.

local Game = game.workspace.Game
local text = game.StarterGui.playersNeeded.TextLabel
--Get player service
local players = game:GetService("Players")

function telePlayers()
	wait(5)
	local target = CFrame.new(-16.725, 6.21, -293.735)
	for i, player in ipairs(game.Players:GetChildren()) do
		--Make sure the character exists and its HumanoidRootPart exists
		if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
			--add an offset of 5 for each character
			player.Character.HumanoidRootPart.CFrame = target + Vector3.new(0, i * 5, 0)
		end
	end
end

--Check player count, run stuff if it’s high enough
while wait() do
	if #players:GetPlayers() > 4 then 
		text.TextTransparency = 1
		text.TextStrokeTransparency = 1
		telePlayers()
	else
		text.TextTransparency = 0 
		text.TextStrokeTransparency = 0.9
	end
end

6 comments

0

what is this

0

because that u found is wrong "text.TextTransparency = 1 22 text.TextStrokeTransparency = 1 23 telePlayers() "

0

could you reword that? im not sure what youre trying to say

0

The Only thing is Transparency 1

0

and the commit script

0

oh I see, thx

2 answers

i recommend using ".Visible" instead of "Transparency" when it comes to gui's(just recommend)

1 comment

0

Thanks for the tip!

Oops, the problem seems to have fixed itself, may have had something to do with roblox's server issues at the current time, but the script now works like it should

This discussion is preserved as it was. New answers, comments, and votes are closed.