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

Please look for spelling or wrong things in this script. I need to know where I went wrong?

Asked by 10 years ago
script.Parent.ClickDetector.MouseClick:connect(function(hit)
repeat wait(0.01) hit.PlayerGui.Tele.Slot.Datteledoe.BackgroundTransparency = hit.PlayerGui.Tele.Slot.Datteledoe.BackgroundTransparency + 0.01 until hit.PlayerGui.Tele.Slot.Datteledoe.BackgroundTransparency >= 1
    hit.PlayerGui.Tele.Slot.Datteledoe.BackgroundTransparency = 0
    hit.PlayerGui.Tele.Slot.Datteledoe.Visible = false
end)
It stays pitch black instead of turning invisible. Please help me?

1 answer

Log in to vote
1
Answered by
Azarth 3141 Moderation Voter Community Moderator
10 years ago
local part = script.Parent
local click = part["ClickDetector"]

cnnct = click.MouseClick:connect(function(player)
 -- So we can disconnect, instead of using a debounce. 
    if player.PlayerGui:findFirstChild('Tele') then
        -- Make sure it's even there.  
        cnnct:disconnect() 
        -- You aren't using it again, so just disconnect it. 
        local dir = player.PlayerGui.Tele.Slot.Datteledoe
        for i = dir.BackgroundTransparency, 1, .1 do
            -- start, stop, increment
            dir.BackgroundTransparency = i 
            wait()
        end
        dir.Visible = false
    end
end)
0
thanks! deputychicken 226 — 10y
Ad

Answer this question