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.
Hey, did it ever work out? 30 words sssssgf343u84rfuvbfjdgdfgdfgf
still brokenâŚ
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?
That all of the if
arguments are not present.
?
Yeah but I have the level 4 cardâŚ
So it does exist.
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:
What do you mean by âPassâ?
I mean âaccess cardâ.
???
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.
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?