So I was making a script where the script will close after pressing a button AFTER activating a prompt but the frame never appears after closing for the first time(after activated for the first time).
Here’s the scripts:
Exiting frame script:
local Exit = script.Parent.Exit
local Shop = script.Parent
Exit.MouseButton1Click:Connect(function()
if Shop.Visible == true then
Shop.Visible = false
else
Shop.Visible = true
end
end)
Script for Prompt
local Button1 = script.Parent
Button1.Triggered:Connect(function(Player)
Player.PlayerGui.Shop.Frame.Visible = true
end)
Likely because your Prompt thing is Server sided and it still thinks your thing is opened. CHange your Prompt script to a localscript, put it in StarterPlayerScripts and change it to this
local Players = game:GetService("Players")
local Button1 = --Location of button
local player = Players.LocalPlayer
Button1.Triggered:Connect(function(Player)
if player ~= Player then
return
end
Player.PlayerGui.Shop.Frame.Visible = true
end)
That if statement is needed or else if one player activates the prompt, everyone else’s will. Remember to state the location of the button in the Button1 variable