Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

(SOLVED) Proximity Prompt for certain Teams?

Asked by 3 years ago
Edited 3 years ago

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  ))
0
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 MarkedTomato 810 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago

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.

0
i Followed your instruction the best i could but sadly it still does not work. https://gyazo.com/e19551dfb2ef246c845997cdbcf2e850 TodoKutski 0 — 3y
0
idk if it makes a difference but i am using a Spawner to change my team TodoKutski 0 — 3y
0
Are there any errors? Also, in this code, the team that doesn't get to see the proximity prompt is the Carnation pink team. mariohead13 129 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

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

0
now the issue i need to work on is making a Proximity Prompt in an NPC that will delete the Pizza (tool) and give the player money (leaderstats) TodoKutski 0 — 3y

Answer this question