I am making a 2 player game with two teams. Player 1 is on Team A while Player 2 is on Team B. Player 2 is trying to find Player 1. Player 1 is able to hide in boxes to help prevent them from being found. To start hiding, Player 1 uses a proximity prompt near the box. While hiding, the proximity prompt action text changes from “Hide” to “Stop Hiding” and they are able to use it to stop hiding.
The problem is that Player 2 is able to see when the action text changes to “Stop Hiding.” Is it possible to make it so that the action text only changes for Player 1?
This is the script I have so far if it helps:
Prompt = script.Parent
local Teams = game:GetService('Teams')
Prompt.Triggered:Connect(function(player)
if player.Team == Teams["Criminal"] then
if Prompt.ActionText == "Hide" then
script.Parent.Parent.Parent.TeleportOut.CFrame = player.Character.HumanoidRootPart.CFrame
player.Character.Humanoid.JumpPower = 0
player.Character.Humanoid.WalkSpeed = 0
for i,v in pairs(player.Character:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("Decal") then
v.Transparency = 1
end
end
player.Character.HumanoidRootPart.CFrame = script.Parent.Parent.CFrame
Prompt.ActionText = "Stop Hiding"
Prompt.HoldDuration = 1
game.ReplicatedStorage.CreateFog:FireClient(player)
else
player.Character.Humanoid.JumpPower = 45
player.Character.Humanoid.WalkSpeed = 13
for i,v in pairs(player.Character:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("Decal") then
v.Transparency = 0
end
end
player.Character.HumanoidRootPart.Transparency = 1
player.Character.HumanoidRootPart.CFrame = script.Parent.Parent.Parent.TeleportOut.CFrame
Prompt.ActionText = "Hide"
Prompt.HoldDuration = 1.75
game.ReplicatedStorage.RemoveFog:FireClient(player)
end
end
end)