I created this on my phone so it may not work but I am positive my code is correct.
working on Group rank only version [Is2]
edit: ok here is the group version i was like bored and i checked this on a Lua checker and i think the local was the only problem so i fixed it. hopes up
instructions:
you must have the item/tool in ServerStorage or Replicated storage.
make a proximity prompt however youd like to customize it and put it in your workspace item .
make a local script and put it under that item with the proximity prompt
I suggest to use Proximity not Proximity2
local Proximity = script.Parent
local Proximity2 = game:GetService(“Workspace”).item.ProximityPrompt
local ProtectedCall = pcall
local GroupId = 0
local GroupRank = 0
Proximity.Triggered:Connect(function(Player)
local Success, Result = ProtectedCall(function()
return Player:GetRankInGroup(GroupId)
end)
if Success and
Result >= GroupRank then
local backpack = player.Backpack
local tool = game.ServerStorage.Cup -- make sure you have that item in serverstorage if not change to replicated storage and change “Cup” to your item mame.
local IsCup = true
local toolClone = tool:Clone()
if IsCup == true then
toolClone.Parent = backpack
end -- this might be an extra end if script doesnt work delete it and try again
end
end
end)
Alright. This resource is nice. I like how you used Group Ranks, for this. I can name multiple ways though to do this though.
For instance, if you want to restrict the proximityprompt for certain players, you could this:
local proximityPrompt = script.Parent
local proximityPrompt2 = workspace.item.ProximityPrompt
local staffMembers = {“Roblox”}
— It would be better to use userids just in case the staff member changes their username.
local staffMemberUserIds = {1}
Proximity.Triggered:Connect(function(player: Player)
local Success, Result = pcall(function()
return table.find(staffMembers, player.Name) or table.find(staffMemberUserIds, player.UserId)
end)
if Success then
— Do Stuff
else
— Do stuff
end
end)
I forgot to mention that there’s a way to make a “Game Creator/Owner Only” Proximity Prompt.
Like this:
local proximityPrompt = script.Parent
local proximityPrompt2 = workspace.item.ProximityPrompt
Proximity.Triggered:Connect(function(player: Player)
local Success, Result = pcall(function()
return game.CreatorId == player.UserId
end)
if Success then
— Do Stuff
else
— Do stuff
end
end)
This is amazing! I need to be honest, I personally will not be needing this, but other developers would find this extremely helpful, like some of my friends, for example. The ability to make staff only proximity prompts would be so useful in cafe games. My friends own cafe games, so I’ll recommend this extremely valuable resource to them!
Why should this be in #resources:community-tutorials? If you’re referring to the instructions shown on the OP, those are the instructions on how to use the script, not how the script works.