I am trying to make the ProximityPromt to be visible to only the Brightorange team (Civilians). Its a cashier that they are able to rob like in jailbreak but, I don’t want the police team to be able to see the promt. Here is the code for the cashier I use.
local Prompt = script.Parent
local Hitbox = Prompt.Parent
local Screen = Hitbox.Parent.Screen
–// Settings //–
local MoneyToGive = 350
local waittime = 120
You should add a separate LocalScript that checks their team and if they are police then make the Enabled property on the Proximity Prompt set to false. (Also, as a security check, on the script you provided add an if statement for if their team is not police then they are allowed to trigger it)
You would always want the function of it to be locked either way for security checks if that’s his goal either way, since if it is changed locally for visibility, it can still be used by hackers if they just make it visible.
For the security check, yes, for the visibility of the proximity prompt, no, since you would have to do that locally since it would be different for each player. But for the security check just do this:
local Prompt = script.Parent
local Hitbox = Prompt.Parent
local Screen = Hitbox.Parent.Screen
–// Settings //–
local MoneyToGive = 350
local waittime = 120
Prompt.Triggered:Connect(function(plr)
if plr.Team.Name ~= "Police" then
plr.leaderstats.Money.Value = plr.leaderstats.Money.Value + MoneyToGive
Prompt.Enabled = false
Screen.Color = Color3.new(1, 0, 0)
wait(waittime)
Prompt.Enabled = true
Screen.Color = Color3.new(0.156863, 1, 0.00784314)
end
end)