Seeking help - Making ImageButton invisible and the appear

Hello,

I’m seeking help - I’ve made a Menu with Play button, however, there’s sprint feature in my game, meaning i need to make a button for mobile devices.

However, after trying many scripts, i just can’t get it working.

Here’s example for the script i’ve tried:

local playerGui = player:WaitForChild("PlayerGui")

local playButton = script.Parent
local sprintButton = playerGui:WaitForChild("MobileSprintGUI"):WaitForChild("Frame"):WaitForChild("SprintImageButton")


sprintButton.Visible = false

playButton.MouseButton1Click:Connect(function()

    playButton.Visible = false 


    task.wait(1.5)

    sprintButton.Visible = true
end)

Here’s the explorer tab that may help.

I would be really happy for any help, and let me know if you will need more information.

Thanks in advance.
-jeziskrista

1 Like

I recreated same thing and it works fine.
Like does the button don’t show up?

1 Like

It could be the button does show up just the positioning of the button may be appearing off-screen for smaller resolutions such as mobile devices.

1 Like

Let me record it and publish as a YouTube video. Give me a minute, please.

That a 2 different buttons

Perhabs?

local playerGui = player:WaitForChild("PlayerGui")

local playButton = script.Parent
local sprintButton = playerGui:WaitForChild("MobileSprintGUI"):WaitForChild("Frame"):WaitForChild("SprintImageButton")


sprintButton.Visible = false

playButton.MouseButton1Click:Connect(function()

    sprintButton.Visible = false 


    task.wait(1.5)

    sprintButton.Visible = true
end)

Video: https://youtu.be/BDyMF0xEHrE

I don’t understand what you mean. Can you explain it to me?

you could just make sprint button invisible manualy instead of by script

Basically what im trying to say is that you confuse 2 variables.

That’s true, I’ll do it, however i still need it to appear after the play button is pressed. With the task.wait.

Still thanks for the idea.

Oh.. I’ll take a look into it. Hopefully i sort it out.

it would apper anyways even if you make it invisible manualy

Well, it does not. I’ll try to make a quick script and get back to you, and tell if it worked out.

Tried many more variants, still not working.

Maybe you have another image button or smth. You could also try to disable and then enable the sprintGui