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)
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.
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
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.
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
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)