Detect when a prompt is triggered, again

basically, i have a script where once the prompt is triggered a tween plays, at the if statement is when it should detect when its triggered, again

the script works until the if statement, as it should be if Open == false and (somehow detect if prompt is triggered then

script.Parent.Triggered:Connect(function()
			PanelSlideTween:Play()
			Panel["Metal Door Slam"]:Play()
			CloseAnim:Play()
			PanelSlideTween.Completed:Wait()
			Open = false
			if Open == false then
				Open = true
				Panel["Metal Door Slam"]:Play()
				PanelSlideTween2:Play()
			end
		end)
	end)
end)

1 Like

I’d do it this way if i were you,

local closed = false

--after this, rest of the code is in the triggered event
    if closed == false then
        closed = not closed
        PanelSlideTween:Play() 
    else
        closed = not closed
        PanelSlideTeeen2:Play() 
    end

Does ‘script.Parent.ActionText’ ever change?

why wouldnt

be in the triggered event?

decided to use 2 prompts and disable then re enable them from eachother, if anyone has a better solution feel free to reply