How would I put a proximity prompt that only one team has, and only the other team can see it?

Basically the title, I’m trying to make a pickpocketing system. I’m guessing I’d have to use instance.new and create a proximit prompt?

2 Likes

You could create a Proximityprompt and disable it, and when teams are chosen, you could make a loop to through the players who are on a specific team, and ultimately by activating the Proximityprompt activated for that team.

1 Like

You’ll probably need to do it client-sided though if you’re wanting to make it work for individual players, so insert the Prompt changes through a LocalScript when you wanna deactivate it

is it possible to do this by putting it in the starterpack, or do I need to use instance.new?

If you already have a Team System setup, you could but it wouldn’t be visible across the server

What I’d recommend instead is using RemoteEvents for handling client-server transportation

--Server
local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent")

Event:FireAllClients()
--Client
local Player = game.Players.LocalPlayer
local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent")

Event.OnClientEvent:Connect(function()
    if Player.TeamColor == BrickColor.new("Bright red") then
        workspace.RedPrompt.Enabled = true
    elseif Player.TeamColor == BrickColor.new("Bright green") then
        workspace.GreenPrompt.Enabled = true
    end
end)
5 Likes

The server script would be in the ServerScriptService and the local script would be in StarterPlayerScripts right?

Right you are, and only run FireAllClients() when you wanna enable the ProximityPrompts for every individual player otherwise it’ll fire instantly

Where would the script create the proximity prompt though?

I’d suggest you create a script in StarterCharacterScripts which would use Instance.new to make a ProximityPrompt, parent it to the character, disable it, and then when someone joins check if the player is on the team that can pickpocket, if they are, enable it for them.

Would I do

instance.new("ProximityPrompt",plr.Character)

?

Well maybe parent it to a specific body part. Eg. plr.Character.Torso, idk. You will need to somehow position it at the back or wherever a player pickpockets from, idk how to do that.

Edit: maybe you can create a new invisible part welded to the body but I have no idea on how to position it according to the body

No clue if this idea will help you at all. But im thinking if you control it with a local script like you would do with a regular interaction script. You can set the interaction to their humanoid. You could use instance.new or you can clone one from script.Parent up to you.