I have a script that creates a ProximityPrompt for the RootPart of all the users who have a rank of 30 or above in my group. It works fine. However, my problem is how to make the player who has the prompt to not able to see it, while everyone else can. I don’t want the proximity prompt to show on their screen constantly as it would be annoying. This is what I have so far
local players = game:GetService("Players")
local groupId = 12345
local minRank = 30
players.PlayerAdded:Connect(function(player)
if player:GetRankInGroup(groupId) >= minRank then
local proxPrompt = Instance.new("ProximityPrompt")
player.CharacterAdded:Wait()
proxPrompt.Name = "prompt"
proxPrompt.Parent = player.Character:WaitForChild("HumanoidRootPart")
proxPrompt.Triggered:Connect(function()
-- Do stuff here
end)
end
end)
You can make it locally for that player, so that he won’t be able to see it but others can.
Try to access that prompt from a localScript and hide it for that player there.
You can keep this script, create a local script now and through there make the player’s prompt invisible/disabled - this way, it’ll only be disabled for him only, and others will be able to see it.
local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local prompt = hrp:WaitForChild("prompt")
--do your stuff