#i want to make the door unlock when the player has the key

1 messages · Page 1 of 1 (latest)

night relic
#
local key = game.ReplicatedStorage.DoorKeys.Key100M
key1 = key.Parent == game.Players.LocalPlayer.Backpack```
how is it possible for the key which is parented to replicated storage be also parented to the localplayer's backpack at the same time. odd
icy kiln
#

idk i dont know much about scripting

echo coyote
#
local lock = game.Workspace.Map.LockedDoors.Lock
local cube = lock.Locked:WaitForChild("Cube")
local click = cube.ClickDetector -- for me continuing a path after waitforchild feels wrong

local plr = game.Players.LocalPlayer

click.MouseClick:Connect(function()
  local key == plr.Character:FindFirstChild("Key100M") or plr.Backpack:FindFirstChild("Key100M")

  if key then
    lock:Destroy()
  end
end)
daring quest
night relic
#

so they compare to the one in storage "somehow"

daring quest
#

ok I think it's better if we don't have to guess lol

#

hm

#

does it work @icy kiln

teal locustBOT
#

studio** You are now Level 10! **studio

daring quest
#

well you should probably close up this thread then

echo coyote
#

felt generous

#

also is my comment real or cap

night relic
daring quest
echo coyote
#

Yeah but like, is putting .Something after waitforchild or findfirstchild or wtv really that bad as I make myself believe it is

night relic
#

or just make the model atomic and you only need to waitforchild on the model

daring quest
#

that's what you really care about

echo coyote
#

cause it gives me the ick when someone types

local this = workspace:WaitForChild("this").Value
daring quest
#

that's not bad imo

echo coyote
#

idk, i dont like this