I was having a similar problem where on the same thing you clicked ‘No’ and it would tween away and when you touched it again it wouldn’t pop up, so I made it a regular script and it pops up now, its a similar issue with the tweens.
Once the tween has completed once you aren’t resetting the HaveCoins position back to it’s original position. When you hit the portal the second time the the gui object is already in that position.
Store it’s original position in a variable and set it before calling the tween.
local player = game.Players.LocalPlayer
local RemoteEvent = game.ReplicatedStorage.SecretStage1
local Screen = player.PlayerGui:WaitForChild("SecretStage1GUI") -- ScreenGui name
local origPos=Screen.HaveCoins.Position
script.Parent.MouseButton1Click:Connect(function()
Screen.HaveCoins.Position=origPos
Screen.HaveCoins:TweenPosition(UDim2.new(0.253, 0, -1, 0), "In", "Back", 1, true)
RemoteEvent:FireServer()
end)
local part = script.Parent
local deb = false
part.Touched:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if not plr or deb then return end
local Screen = plr.PlayerGui["SecretStage1GUI"] -- ScreenGui name
if plr.leaderstats.Coins.Value < 150 then
Screen.NotHaveCoins:TweenPosition(UDim2.new(0.253, 0, 0.294, 0), "In", "Back", 1, true)
deb = true
wait(1)
deb = false
elseif plr.leaderstats.Coins.Value >= 150 then
Screen.HaveCoins:TweenPosition(UDim2.new(0.253, 0, 0.294, 0), "In", "Back", 1, true)
deb = true
wait(1)
deb = false
end
end)