How to disable Proximity Prompt visability locally (for a dialogue mechanic)?

Hello!

So I have a Dialogue that shows after you interact with Proximity Prompt:

local rs = game:GetService("ReplicatedStorage") 

local ProximityPrompt = script.Parent

ProximityPrompt.TriggerEnded:Connect(function(player)
	script.Parent.ClickablePrompt = false
	local turtle = script.Parent.DialogueGui -- that dialogue
	turtle.Parent = player.PlayerGui
end)

And I want to make it (the proximity prompt) invisible/uninteractable to the player who already used it, but others still can interact with it

I’m not entirely sure how to do that, since I don’t know how you can disable it locally in the first place, so if there’s any solutions - thanks in advance!

1 Like

Use a remote event to tell the client to disable their proximity prompt, and add server side validation to make sure they can’t press it again.

  1. Change your server script to this:
--//Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")

--//Variables
local HideDialoguePrompt = ReplicatedStorage.HideDialoguePrompt
local ProximityPrompt = script.Parent

--//Tables
local hasInteracted = {}

--//Functions
ProximityPrompt.Triggered:Connect(function(player)
	if hasInteracted[player] then
		return
	end
	
	hasInteracted[player] = true
	HideDialoguePrompt:FireClient(player)
	
	local turtle = ProximityPrompt.DialogueGui:Clone()
	turtle.Parent = player.PlayerGui
end)
  1. Make a RemoteEvent called HideDialogue:
    image

  2. Make a LocalScript in StarterPlayerScripts, and paste this inside:

--//Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")

--//Variables
local HideDialoguePrompt = ReplicatedStorage.HideDialoguePrompt
local ProximityPrompt = workspace.ProximityPrompt --//Reference your proximity prompt

--//Functions
HideDialoguePrompt.OnClientEvent:Connect(function()
	ProximityPrompt.Enabled = false
end)
4 Likes

Hm… it seems that it still doesn’t work…

Here’s what I have to make sure I did everything right:
image
The location of a script (from the step 1) with basically copy and pasted code
image
Name and location of an Event

And, well, the local script (also basically copied and pasted but with locations changed properly):
image

1 Like

No errors? Also, you should be using .Triggered instead of .TriggerEnded.

well, I did add “Print” statements to a Local script, and it doesnt print stuff, so maybe the issue is the fact that it doesnt reach it somehow?

Also, I did change .TriggerEnded to .Triggered

I checked and I did refer to the Event everywhere correctly, so it is weird not gonna lie…

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