When one of the prompts are triggered another one gets canceled

local function activateCustomer(friendCustomer)
	local connections = {}
	
	local customerFolder = friendCustomer.Parent
	
	local customerActivationPrompt = friendCustomer.HumanoidRootPart.InteractPrompt
	local customerStatusGui = friendCustomer.CustomerStatusGui
	local statusLabel = customerStatusGui.StatusLabel
	
	friendCustomer:GetAttributeChangedSignal(npcStatusAttributeName):Connect(function()
		statusLabel.Text = friendCustomer:GetAttribute(npcStatusAttributeName)
		
		for _, connection  in connections do
			connection:Disconnect()
		end
	end)
	
	changeStatusForNpcs(customerFolder, "Waiting For Waiter")
	connections["WaitForCustomer"] = customerActivationPrompt.Triggered:Wait()
	changeStatusForNpcs(customerFolder, "Choosing Dish")
	connections["ANotherConnection"] = customerActivationPrompt.Triggered:Wait()
	changeStatusForNpcs(customerFolder, "NOT Choosing Dish")
end

here is what i tried but it didnt work since .Triggered:Wait() isnt a connection

When the function fires you can just set Enabled false for the ProximetyPrompts you don’t want. Just remember to set Enabled to true at the end of your code.

1 Like

Thats exactly what i did. still thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.