#how to fix my skip button not working 😔

1 messages · Page 1 of 1 (latest)

brisk mantle
#

i want to make it so that it only recieves and registers one click, cuz when you spam the skip button the menu crashes, so like i want to register only one time but this script aint working

fallen hareBOT
#

studio** You are now Level 1! **studio

brisk mantle
#

local ts = game:GetService("TweenService")
local info = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local screengui = script.Parent.Parent.Parent.Parent

script.Parent.MouseButton1Click:Connect(function()
local value = true
if value then
value = false

    wait(0.5)
    
    local ts = game:GetService("TweenService")
    local info = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
    local plrGui = game:GetService("Players").LocalPlayer.PlayerGui

    local sidebar = plrGui.Sidebar.MainFrame.ButtonsFrame:WaitForChild("zExpandContract")
    local billBrd = plrGui.BillboardGui:WaitForChild("BillboardGui")
    local main = plrGui:WaitForChild("Main")
    local inv = plrGui:WaitForChild("Inventory")


    script.Parent.Parent.Parent.LoadingSequenceScript.Enabled = false

    main.Enabled = false
    inv.Enabled = false
    sidebar.Visible = false
    billBrd.Enabled = true
    script.Parent.Parent.Parent.Parent.Camera.Enabled = true

    wait(0.5)
    ts:Create(script.Parent.Parent.Parent, info, {GroupTransparency = 1}):Play()
    wait(0.5)
    ts:Create(script.Parent.Parent.Parent.Parent.MainFrame.Title, info, {GroupTransparency = 0}):Play()
    script.Parent.Parent.Parent.Parent.MainFrame.Title.Visible = true
    wait(0.05)
    ts:Create(script.Parent.Parent.Parent.Parent.MainFrame.Buttons, info, {GroupTransparency = 0}):Play()
    script.Parent.Parent.Parent.Parent.MainFrame.Buttons.Visible = true
    
elseif value == false then
    repeat task.wait() until value == true
end

end)

#

i tried messing with the else statement, making it elseif, making it else, removing the entire statement, reverting the value to true after operation (which i thought was useless cuz you can't literally press the skip button for the second time, it'll already be gone)

#

i tried messing with the debounce

#

argh

#

actually it seems to not work at all

#

even if you pressed it once and never spammed

#

wait lemme look into it more

crude hemlock
#

you are making it so when you click the button value is set to true

#

which makes the debounce useless

#

put it outside of the MouseButton function

brisk mantle
#

do i remove else?

crude hemlock
#

its pretty useless here since the script wont run anyway if value is false

#

so yeah

#

you can

#

if value then

end

brisk mantle
#

oh alr

#

i just saw i had two variables of the same kind, one from the inside and one from the out ☠️

#

OH SHIT

#

i forgot about this line 😭

#

script.Parent.Parent:WaitForChild("Camera").Enabled = true
script.Parent.Parent:WaitForChild("MainFrame").Visible = true

#

OMG

#

thanks

#

it works