Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited by Ziffixture 4 years ago

This question has been solved by the original poster.

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
0
what is this DrTrayBlox23Admin -5 — 4y
0
because that u found is wrong "text.TextTransparency = 1 22 text.TextStrokeTransparency = 1 23 telePlayers() " DrTrayBlox23Admin -5 — 4y
0
could you reword that? im not sure what youre trying to say MOREHOURSOFFUN 104 — 4y
0
The Only thing is Transparency 1 DrTrayBlox23Admin -5 — 4y
View all comments (2 more)
0
and the commit script DrTrayBlox23Admin -5 — 4y
0
oh I see, thx MOREHOURSOFFUN 104 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago

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

0
Thanks for the tip! MOREHOURSOFFUN 104 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

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

Answer this question