Is it possible to make proximity prompt invisible to only 1 player?

I want to make a game (That is the point of this website lol) and in this game there will be proximity prompts on all the players, but is it possible to make it so that the players cannot see their own prompts? Idk if you need this but here is the script that gives the players the prompts.


local players = game:GetService('Players')


players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local promptClone = script.RequestPrompt:Clone()
		promptClone.Parent = char:FindFirstChild("NameTag")
		promptClone.ActionText = "Link up with ".. player.Name
	
	end)
end)
2 Likes

this is a servers cript though and server means it appears for everyone. just put the clone part in a local script

2 Likes

Use a Local Script in order to make a prompt invisible for certain clients.

1 Like

And how would I do that? Because if I put the entire script in a local script, only the player that has the prompt can see it, and I want the complete opposite so that only he CANT see it.

1 Like

You can use a localscript for that

1 Like

Make it so if something about the player is true, it will disable the ProximityPrompt in a LocalScript.

Like:

-- In a LocalScript
if player.Property == true then do
    [ProximityPromptLocation].Enabled = false
end
2 Likes

Don’t do what @CenterWalled said, atleast not in the ServerSide script as it would disable the prompt for everyone, instead:

Use your script and add a localscript into StarterCharacterScripts:

local char = script.Parent
local nTag = char:FindFirstChild("NameTag")
repeat wait() until nTag
local prompt = nTag:FindFirstChild("RequestPrompt")
repeat wait() until prompt

prompt.Enabled = false

I said to put it into a LocalScript, so it should work. You may just need a RemoteEvent to trigger it.

Oh well I oversaw that but I think your way is not so efficient if you have to fire a remoteevent and its also more complex i’d say

So I left my original script in server script service, and put yours in a local script, inside of starter character scripts, but it still does not work. No errors btw. Did I forget to do something?

Create the prompt then mark as disabled in studio so every player will not able to use it.
In some localScript code of the player you need to enabled it in the code.

in a local script do this

local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()

local promptClone = script.RequestPrompt:Clone()
promptClone.Parent = char:FindFirstChild("NameTag")
promptClone.ActionText = "Link up with ".. plr.Name

Am I supposed to put this in server script service? And do I put the proximity prompt inside it aswell?

This is the most inefficient way you could’ve done this. :WaitForChild exists for a reason.

@deathwish128000 The way to do this would be to create a LocalScript in StarterPlayerScripts, that would destroy the proximity prompt when it loads in.

Code:

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

--//Variables
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.CharacterAdded or LocalPlayer.CharacterAdded:Wait()

--//Functions
local function OnCharacterAdded(character)
	local requestPrompt = character:WaitForChild("NameTag"):WaitForChild("RequestPrompt")
	requestPrompt.Enabled = false
end

LocalPlayer.CharacterAdded:Connect(OnCharacterAdded)
OnCharacterAdded(Character)
1 Like

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