The issue at hand is im creating a Delivery Team for an RP game and i want to limit the Proximity Prompt to ONLY be Used (and possibly seen) by the "Delivery" team
this is the script i have that is not working, ignore the // as they are not part of the actual code (im NEW to roblox coding so please be gentle)
// local player = game:GetService("Players")
// player.PlayerAdded:Connect(function(player)
// if player.TeamColor == BrickColor.new("Carnation pink") then // local prp = script.Parent // local pizza = game.ServerStorage.Pizza // prp.Triggered:Connect(function(player) // pizza:Clone() // pizza.Parent = player.Backpack // game.StarterPlayer.Pizza.Value = true // prp.Enabled = false // end) // end ))
I believe this is because it is in a server sided script. You would need to use a remoteEvent and fire it to the client, from the server. Add a remoteEvent to replicated Storage.
This would be your new server sided script.
local remoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEventName") local player = game:GetService("Players") player.PlayerAdded:Connect(function(player) if player.TeamColor == BrickColor.new("Carnation pink") then local prp = script.Parent local pizza = game.ServerStorage.Pizza prp.Triggered:Connect(function(player) pizza:Clone() pizza.Parent = player.Backpack remoteEvent:FireClient(player, prp, pizza) end) end ))
And this would be a localscript inside of replicatedFirst
local remoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEventName") remoteEvent.OnClientEvent:Connect(function(prp, pizza) pizza.Value = true prp.Enabled = false end)
Please tell me if you need more explanation or if something isn't working.
For this one, I had to make it as an experience because it has a lot of stuff in it. Anyway, the experience has an explanation in scripts.
https://www.roblox.com/games/7417603339/Delivery-Team-tutorial