I’m attempting to achieve to make a locally-opened door for a game, locally mostly because I really don’t want people to keep opening the door for everyone. This is a localscript under a part as it’s parent.
The code I have currently, is:
script.Parent.Touched:Connect(function()
local key = game.Players.LocalPlayer.Backpack:FindFirstChild("Key")
if key then
local tag = key:FindFirstChild("canOpen")
if tag then
script.Parent.Transparency = 0.5
script.Parent.CanCollide = false
end
end
end)
Then the above should work! Since canOpen is found inside the tool, you obtained it correctly. But to access the value of the boolean, you need to also specify the .Value in the end.
Do you also make sure to give the player the key at some point (set the canOpen.Value = true) ?