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

in this code below, the gui doesn't appear??

local tool = script.Parent
local event = game.ReplicatedStorage.StrengthEvent
local debounce = false
local plr = game.Players.LocalPlayer
local waitGui = plr.PlayerGui:WaitForChild("ScreenGui")
local gui = waitGui.Strength.TextTransparency

tool.Activated:Connect(function()
	if not debounce then
		debounce = true
		for i = 1, 0, .1 do
			gui = i
			wait()
		end
		wait()
		event:FireServer()
		wait(2)
		for i = 1, 0, -.1 do
			gui = i
			wait()
		end
		debounce = false
	end	
end)

the gui doesn't appear... im not sure what to do e.e and i had to expand the title.

2 comments

0

i think im overusing waits though lol

0

Maybe you want to accept my answer? If you could, I'm appreciated. :))

1 answer

Your code has several problems.

  1. gui = waitGui.Strength.TextTransparency, well use waitGuit.Strength.

  2. for i = 1, 0, .1 do, you cannot count down from 1 to 0 per 0.1.

I fixed your code; Hope it helps.

local tool = script.Parent
local event = game.ReplicatedStorage.StrengthEvent
local debounce = false
local plr = game.Players.LocalPlayer
local waitGui = plr.PlayerGui:WaitForChild("ScreenGui")
local gui = waitGui.Strength

tool.Activated:Connect(function()
    if not debounce then
        debounce = true
        for i = 0, 1, .1 do
            gui.TextTransparency = i
            wait()
        end
        wait()
        event:FireServer()
        wait(2)
        for i = 1, 0, -.1 do
            gui.TextTransparency = i
            wait()
        end
        debounce = false
    end 
end)

1 comment

0

ah thanks, it definitely helps. i just started coding a week ago :)

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