In simple terms, I’m making a cutscene, it starts by the user holding down “E” via ProximityPrompt. Because I don’t want the proximity prompt in the way of the cutscene, I coded it so that it would destroy it. After the cutscene I want it to be added back again so the player can play the cutscene twice, so I made a function that makes the ProximityPrompt and puts it inside the player. I putted the function at the start of the code then at the end of the code, when the cutscene ends.
The problem is that the cutscene would not play the second time even though the proximityprompt is present. What can I do to fix this? Thank you.
Heres the code
local function triggeredAdded()
local triggered = Instance.new("ProximityPrompt")
triggered.Name = "triggered"
triggered.Parent = workspace.BlackMarket
triggered.ActionText = "Black Market"
triggered.Enabled = true
triggered.HoldDuration = 1
triggered.KeyboardKeyCode = "E"
end
triggeredAdded()
workspace.BlackMarket.triggered.Triggered:Connect(function()
workspace.BlackMarket.triggered:Destroy()
-- some code I put blah blah blah
triggeredAdded()
end)