I'm making a Greeting Gui to go with my chat commands and things aren't going to well. It seems that ROBLOX Studio isn't running a section of my code, the part where the text is set and the check on the player's permission is done. An reason why?
Code
local Player = game.Players.LocalPlayer
local PlayerGUI = Player.PlayerGui
local StartMenu = PlayerGUI:WaitForChild("StartMenu")
local Text = StartMenu:WaitForChild("Text")
local ModulePlayerNms
local PromptStartMenu = game.ReplicatedStorage.PromptStartMenu
PromptStartMenu.OnClientEvent:Connect(function(Table)
ModulePlayerNms = Table
end)
function CheckPlayerPerm(PlayerToCheck, ModuleToSearch)
local IfPlayer
for _, plr in pairs(ModuleToSearch) do
if PlayerToCheck.Name == plr then
IfPlayer = PlayerToCheck
end
if IfPlayer ~= nil then
return true
else
return false
end
end
end
for Transparency = 1, 0, -.01 do
Text.BackgroundTransparency = Transparency
wait(.001)
end
local TextString = "Thank You For Using J-Commands! This Is Still In BETA Phase So Except Some Bugs..."
local IfAdminText = "Welcome, "..Player.Name.." You Have Permission To Use Commands!"
if Text.BackgroundTransparency == 0 then -----------NEVER SEEMS TO RUN?!
for i = 1, #TextString do
Text.Text = string.sub(TextString, 1, i)
wait(.07)
end
wait(2)
if CheckPlayerPerm(Player, ModulePlayerNms) then
for i = 1, #IfAdminText do
Text.Text = string.sub(IfAdminText, 1, i)
wait(.07)
end
end
end
----SKIPS TO HERE
wait(2)
for Transparency = 0, 1, .01 do
Text.BackgroundTransparency = Transparency
Text.TextTransparency = Transparency
wait(.001)
end
wait(3)
StartMenu:Destroy()
print("Done!")
Area that doesn't run
local TextString = "Thank You For Using J-Commands! This Is Still In BETA Phase So Except Some Bugs..."
local IfAdminText = "Welcome, "..Player.Name.." You Have Permission To Use Commands!"
if Text.BackgroundTransparency == 0 then -----------NEVER SEEMS TO RUN?!
for i = 1, #TextString do
Text.Text = string.sub(TextString, 1, i)
wait(.07)
end
wait(2)
if CheckPlayerPerm(Player, ModulePlayerNms) then
for i = 1, #IfAdminText do
Text.Text = string.sub(IfAdminText, 1, i)
wait(.07)
end
end
end

6 comments
The BackgroundTransparency appears as 0.01, not 0.
So I would check if it was equal to 0.01?
That cant be right, its meant to loop until it reaches to 0
Do yyou think i should remove the conditional instead?
Try removing the end on line 27 maybe that works
The condition checking of BackgroundTrasparency seems redundant as you previously ran a loop that guarenteed it to be 0. I would just remove that if statement altogether.