Staff only wall

Hello guys! I need some help with a staff only wall, I came across this topic:

The issue I’m having is it’s not working at all.

Original script:

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)

What I mortified:

local Proximity = script.Parent
local Proximity2 = game:GetService(“Workspace”).Part.ProximityPrompt1

local ProtectedCall = pcall
local GroupId = 17256639
local GroupRank = 1

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.Part1 -- 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)

Thanks,
@MrBagel2021

1 Like

Try this code:

local Proximity = script.Parent
local Proximity2 = workspace.Part.ProximityPrompt1

local GroupId = 17256639
local GroupRank = 1

Proximity.Triggered:Connect(function(Player)
    local Rank
	local Success, Errmsg = pcall(function()
		Rank = Player:GetRankInGroup(GroupId)
	end)

	if Success and Rank >= GroupRank then
		local backpack = player.Backpack
		local tool = game.ServerStorage.Part1 

		local toolClone = tool:Clone()
		toolClone.Parent = backpack
	end
end)

Make sure it’s not a local script.

I can try a normal script, but in the topic it says a local script

You are trying to access ServerStorage from a LocalScript. Since anything on the server does not replicate to the clients, the Part1 instance in the ServerStorage won’t exist.

Still not working, they want the proximity prompt in workspace and the wall in serverstorage

You can put the code in a Script instance(not a LocalScript), and parent it under the ProximityPrompt and it should run fine.

So just put the script in the proximity prompt? And it should work

Still not working, the wall just stays invisible

Try again(I updated the script), and yes put the script in the proximity prompt.

Still not working, the wall is till not showing

This script is not supposed to make a wall visible, its purpose is to parent a tool to the player’s backpack.

I want it so when a player clicks it, it teleports them to the other side of the wall. When I say players I mean staff

Then you should’ve described your issue better. I thought u needed help with your version of the script not working.
Try this:

local Proximity = script.Parent

local GroupId = 17256639
local GroupRank = 1

Proximity.Triggered:Connect(function(Player)
    local Rank
	local Success, Errmsg = pcall(function()
		Rank = Player:GetRankInGroup(GroupId)
	end)

	if Success and Rank >= GroupRank then
       local Position = Vector3.new() -- The position you want to teleport the player to
       local Character = Player.Character
       if not Character or not Character:FindFirstChild("Humanoid") then return end -- Checking if character exists 

       Character:MoveTo(Position) -- Moves the player's character to the desired position 
	end
end)
1 Like

Sorry, does the wall still stay in serverstorge?

Can you explain in detail what you have and what you need? We can’t help you unless you explain your situation properly and in detail.

The code I gave you teleports a player to a position if they have a rank in a group.

I need help with a staff only wall, I want to make it so a staff member can click the proximity prompt then it teleports them to the other side of the wall. I have the proximity prompt in workspace and the wall in serverstorage

You can place the wall in the workspace since we don’t need it for anything, then you can put the code in a script that’s parented under the ProximityPrompt in the workspace.

Then all you have to do is to enter the position the player is going to be teleported to, and it’s done.

Okay, sorry for asking, but how do I find the position?

Pretty easy, you can either replace the Vector3.new() with a part’s position that you want to teleport the player to (in that case you can do part.Position), or you can put a part behind your staff wall where you want the staff to be teleported, copy the position of that part, remove the part, and then paste the position value in the Vector3.new().
(for example, Vector3.new(0,0,0))
Also, I updated the code again. The Proximity2 variable was unnecessary.

Still not working, do I change all the “Proximity”'s to what I have my proximity named?