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
i would re-write the section :
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
As
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 math.floor(Text.BackgroundTransparency+0.5) == 0 then ----------- 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
Since the code you're dealing with 0.0n numbers and that for loop doesn't get to 0 so you would have to round the number to the nearest int
Or change your for loop:
From
for Transparency = 1, 0, -.01 do Text.BackgroundTransparency = Transparency wait(.001) end
to
for Transparency = 1, 0, -.01 do Text.BackgroundTransparency = Transparency wait(.001) end Text.BackgroundTransparency = 0 -- make sure the BackgroundTransparency is at 0 not 0.01 or something! --// little hacky i know lol but its a way to make sure the transparency is at 0 so the following if statement works!
Hope this helps!