Team Only Prompt

The prompt having a custom UI to it.

image

When coding the Custom Prompt UI and the prompt when someone is on the “Counter Staff” team, it doesn’t make the UI and the prompt visible for them.

Code:

local folder = game.Workspace.PopCorn_Machine
local Prompt = folder.PopCornMachinePrompt:FindFirstChild("ProximityPrompt")
local PromptUI = Prompt.CustomPrompt

local function onPromptTriggered(player)
	if player.Team == game.Teams.CounterStaff then
		PromptUI.Enabled = true 
	else
		PromptUI.Enabled = false 
	end
end

Prompt.Triggered:Connect(onPromptTriggered)

When testing this, it doesn’t show the UI or the prompt

1 Like

where is the code placed?, also why hide it after triggering?

Its placed in the Serverscriptstorage folder

Does the proximityprompt have RequiresLineOfSight off?

Change the Prompt Enabled property in client instead.

local Player = game:GetService("Players").LocalPlayer
local Prompt = workspace.PopCorn_Machine.PopCornMachinePrompt:FindFirstChild("ProximityPrompt").CustomPrompt
Player.Team.Changed:Connect(function()
	Prompt.Enabled = Player.Team.Name == "CounterStaff"
end)

yea it does, sorry for late response.