However, here’s the issue: it doesn’t work for me.
The player joins the server and, through the server, I create the Proximity Prompt attached to them. However, I only want it so it’s visible on other players and not the client, so I switched Enabled to false on the client itself.
However, that gives me another setback - disabling it, although it’s done locally, disables all of the prompts in the server.
Edit:
Out of curiosity, I tested this in studio and found this isn’t a problem. You’ve probably set up your prompts wrong somehow. Maybe show some code?
--SERVER
local Players = game:GetService("Players")
local Replicated = game:GetService("ReplicatedStorage")
local DisablePrompt = Replicated:WaitForChild("DisablePromptRemote")
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local HRP = Character:WaitForChild("HumanoidRootPart")
local Prompt = Instance.new("ProximityPrompt")
Prompt.Parent = HRP
Prompt.RequiresLineOfSight = false
DisablePrompt:FireClient(Player)
end)
end)
--LOCAL
local Players = game:GetService("Players")
local Replicated = game:GetService("ReplicatedStorage")
local DisablePrompt = Replicated:WaitForChild("DisablePromptRemote")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local HRP = Character:WaitForChild("HumanoidRootPart")
local Prompt = HRP:WaitForChild("ProximityPrompt")
DisablePrompt.OnClientEvent:Connect(function()
Prompt.Enabled = false
end)
The server script goes inside ServerScriptService and the local script goes inside StarterCharacterScripts. A remote event instance is required, which I’ve named “DisablePromptRemote” and it should be placed inside the “ReplicatedStorage” directory.
The prompt is instanced by the server and then disabled by the client for the player of which the prompt belongs to (is inside the character model of). The disabling of a prompt by a client will not replicate across the server to other clients and as such the prompt will still be enabled for every other client (and the server itself).