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

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

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago

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!

Ad

Answer this question