Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

So um why is this simple script not working? It has something to do with a Image Button

Hello! I am a new scripter encountering a problem. My problem is that this image button is not doing what its supposed to do. I am making a thing where if u stand on this platform, it opens up this shop (sorta like the simulator shops), although X button to close out of the shop is not working. Can someone help me? Here is the script.

game.workspace.Shop.Touched:Connect(function(partThatTouchedIt)
	
	game.StarterGui.ScreenGui.CloseButton.Visible = true
	
	local cam = workspace.CurrentCamera
	local FocusPart = game.Workspace.FocusPart
	
	cam.CameraType = "Fixed"
	cam.Focus = FocusPart.CFrame
end)

1 answer

Just like you did here game.StarterGui.ScreenGui.CloseButton.Visible = true do it again but when the player clicks the X. For example,

CloseButton.MouseButton1Down:Connect(function()
	game.StarterGui.ScreenGui.Visible == false
end

Just like that, obviously place the script in the correct place and change the names up and stuff like that, but that's how you do it. You're welcome!

This discussion is preserved as it was. New answers, comments, and votes are closed.