I am making a game and in part of it, you press a button on the screen and an image shows up. How can I script the button so when you click it the image pops up?
COMMUNITY QUESTION
How would I use a button to make an image appear?
1 answer
local script in the button
local thingthatappears = location of the image that will appear
script.Parent.MouseButton1Click:Connect(function()
if thingthatappears.Visible == false then
thingthatappears.Visible = true
end
end)
make sure thingthatappears.Visible = false before the script runs. This is only the most basic way to use guis. You can use things like TweenService to your liking. Looks complicated, but once you learn it, you look like a pro. Really recommend checking it out.
https://developer.roblox.com/en-us/api-reference/function/GuiObject/TweenPosition
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Please follow https://scriptinghelpers.org/help/how-post-good-questions-answers