Hi developers!
I’m trying to get a system that will disable all the ProximityPrompts within a specific model when that player joins the game. It should only happen to those that fall in under the staff rank within a group. For now I have set it to >= 1 just for testing purposes.
The model in question is not prespawned in the game, however it should be before anyone below that staff rank gets in game.
This is what I have currently but does not work.
‘AWConnect’
LocalScript
local Player = game.Players.LocalPlayer
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
if Player:GetRankInGroup(16530381) >= 1 then
print("Matches Group")
for i,Connect in pairs(workspace:GetDescendants()) do
if Connect:WaitForChild("AWConnect").Parent then
print("Finds AWConnect")
for i, Prompts in pairs(Connect:GetDescendants()) do
if Prompts.ClassName == "ProximityPrompt" then
print("Finds Prompts")
Prompts:Destroy()
print("Destorys Prompts")
end
end
end
end
end
end)