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

this repeat wait until loop keep going after the transparancy has hit 0 how to fix this?

Asked by
hokyboy 270 Moderation Voter
3 years ago
--//Varibles\\--
local Plr = game.Players.LocalPlayer
local repStorage = game:GetService("ReplicatedStorage")
local RemoteFolder = repStorage:WaitForChild("RemoteEvents")
local UI = Plr:WaitForChild("PlayerGui")
local Gui = UI:WaitForChild("PlrUI")

local function TextRemote()
    repeat wait(0.01)
        Gui.Title.TextTransparency = Gui.Title.TextTransparency - 0.01
        Gui.Title.Title.TextTransparency = Gui.Title.Title.TextTransparency - 0.01
        until Gui.Title.TextTransparency == 0 do
    end
end


RemoteFolder.TextRemote.OnClientEvent:Connect(TextRemote)

It keeps going until the transparancy is in the -1 and it just keeps going

0
Gonna be honest, i don't see any problems with the code but you have "Gui.Title.Title" and I'm not sure if your checking the right thing or your 'Text Remote' is broken. Also, your using a specific value, try using > or < to try and identify it if it still isn't working. The reason i won't give this as an answer is because I'm uncertain whether it's helpful or not. Metacalled2 142 — 3y
0
Those are some nasty names. DiamondComplex 285 — 3y
0
you should also try to use a numeric for loop AntoninFearless 622 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

I would recommend doing

until Gui.Title.TextTransparency <= 0

this way, if it by chance goes past 0, it will still stop, I have run into this problem before so this should help. and if your trying to make it become less transparent faster replace

wait(0.01)

with

wait()

this will work without crashing your game

Ad

Answer this question