Proximity Prompt Script

Do you have either level_2 or level_3 keycards in your backpack or equipped?

local Access = {
    "Level_2",
    "Level_3"
}
local ProximityPrompt = script.Parent
local Door = script.Parent.Parent.Parent.Parent.Parent.Door

ProximityPrompt.Triggered:Connect(function(player)
	if ProximityPrompt.ActionText == "Open" then
	
    	for i,v in pairs(Access) do
           if player.Character:FindFirstChild(v) or player.Backpack:FindFirstChild(v) then
               Door.Transparency = 1
            	Door.CanCollide = false
                 ProximityPrompt.ActionText = "Close"
            	print(player.Name)
    
                break
           end
    	end
    end
end)

I made a mistake try this

Ok.

gflkmdgmnfdgjnkfdjkngskdmvkld

I hate that you need 30+ characters. :roll_eyes:

Hey, did it ever work out? 30 words sssssgf343u84rfuvbfjdgdfgdfgf

:pensive: still broken… :pensive:

should I send a video?

Maybe none of these things exist and that’s why the code doesn’t enter the if.

…

What do you mean? :confused:

That all of the if arguments are not present.

?

Yeah but I have the level 4 card…

So it does exist. :confused:

wordssss

Your script works fine.

But you probably don’t actually have a pass.

Put your pass inside of StarterPlayer->StarterCharacter and then test your game.

Adding the pass from the client (or the default studio interface) will only add it to the client, not the server.

You can double check what the server thinks by adding this line right after your Connect line:

	print(player.Name, "triggered. Player children:", player:GetChildren(), "Character chilren:", player.Character:GetChildren())

And expand the tables to see if you see your pass.

You could also use this button to run the server and client in separate windows. Add the pass to the server window and see if the door works:

image

What do you mean by “Pass”?

:confused:

I mean “access card”.

??? :confused:

That card. You think you have it. I’m saying you don’t, on the server. Did you follow my instructions to check?

Yes, I do have it. I checked. :confused:

You’re saying that, when you test with a server + one player, there is an object called “Level_4” inside of the Player object, on the server window too? Not just the client window?

@nicemike40 is saying the same thing as me. You probably have the card only on client (or you don’t have it) and you are checking if someone have it on the server.

Did you debug it yet? What part runs? What part doesn’t run?