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

Why is this script not making the textlabels dissappear?

Asked by
Foridex 46
5 years ago
local chlg = script.Parent.chlg
local start = script.Parent.start
local B1 = script.Parent.changelog["1"]
local B2 = script.Parent.changelog["2"]
local B3 = script.Parent.changelog["3"]
local tp = script.Parent.changelog.chlg

chlg.MouseButton1Click:connect(function()
    chlg.Confirm:Play()
    for i = 1,1000 do
        B1.TextTransparency = B1.TextTransparency + .01
        B2.TextTransparency = B1.TextTransparency + .01
        B3.TextTransparency = B1.TextTransparency + .01
        tp.TextTransparency = tp.TextTransparency + .01
        wait()
    end
    script.Parent.changelog.Visible = false
    wait(2)
    script.Parent.Handler.Disabled = false
    script.Disabled = true
end)

This script is supposed to make the textlabels dissapear with a click of a button. The button works, but the rest doesn't. Here's the script that makes them appear for reference:

local chlg = script.Parent.chlg
local start = script.Parent.start
local B1 = script.Parent.changelog["1"]
local B2 = script.Parent.changelog["2"]
local B3 = script.Parent.changelog["3"]
local tp = script.Parent.changelog.chlg

game.Players.LocalPlayer.PlayerGui:SetTopbarTransparency(0)

chlg.MouseEnter:connect(function()
    chlg.Click:Play()
end)
chlg.MouseLeave:connect(function()
    chlg.Click2:Play()
end)
start.MouseEnter:connect(function()
    start.Click:Play()
end)
start.MouseLeave:connect(function()
    start.Click2:Play()
end)

chlg.MouseButton1Click:connect(function()
    chlg.Confirm:Play()
    script.Parent.changelog.Visible = true
    for i = 1,1000 do
        B1.TextTransparency = B1.TextTransparency - .01
        B2.TextTransparency = B1.TextTransparency - .01
        B3.TextTransparency = B1.TextTransparency - .01
        tp.TextTransparency = tp.TextTransparency - .01
        wait()
    end
    wait(2)
    script.Parent.Handler2.Disabled = false
    script.Disabled = true
end)

0
First of all, is it in a localscript? Nixvoid 12 — 5y
0
Yes Foridex 46 — 5y
0
also why is it in a for loop? would you not want it to just make the textlabels disappear completely, or is it a loop where, they enable then disable continuously? Nixvoid 12 — 5y
0
I want them to fade out in that script, but it wont. Foridex 46 — 5y
View all comments (5 more)
0
I see what you mean now, I made a model test of your script to see what the problem could be but there is no error being shown in the output. My only recommendation is doing it old school, but I'm sure you wouldn't want to spend a long time scripting. I have to go soon anyway. I hope your question gets answered. :) Nixvoid 12 — 5y
0
Thanks. Foridex 46 — 5y
0
wait, do you want it to disappear on click? worklok -24 — 5y
0
Yes Foridex 46 — 5y
0
Is your appear script working? oftenz 367 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

Will this work for you?

local chlg = script.Parent.chlg
local start = script.Parent.start
local B1 = script.Parent.changelog["1"]
local B2 = script.Parent.changelog["2"]
local B3 = script.Parent.changelog["3"]
local tp = script.Parent.changelog.chlg

game.Players.LocalPlayer.PlayerGui:SetTopbarTransparency(0)

chlg.MouseEnter:connect(function()
    chlg.Click:Play()
end)
chlg.MouseLeave:connect(function()
    chlg.Click2:Play()
end)
start.MouseEnter:connect(function()
    start.Click:Play()
end)
start.MouseLeave:connect(function()
    start.Click2:Play()
end)

chlg.MouseButton1Click:connect(function()
    chlg.Confirm:Play()
    script.Parent.changelog.Visible = true
    for i = 0,1, 0.1 do --- changed this
        B1.TextTransparency = B1.TextTransparency = i  --- Changed This
        B2.TextTransparency = B1.TextTransparency = i  --- Changed This
        B3.TextTransparency = B1.TextTransparency = i  --- Changed This
        tp.TextTransparency = tp.TextTransparency = i  --- Changed This
        wait()
    end
    wait(2)
    B1.Visible = false  --- Added this
    B2.Visible = false  --- Added this
    B3.Visible = false  --- Added this
    script.Parent.Handler2.Disabled = false
    script.Disabled = true
end)

I hope this will work for you!

Ad
Log in to vote
0
Answered by
Foridex 46
5 years ago

No it doesn't, sorry.

Answer this question