#i want to make the door unlock when the player has the key
1 messages · Page 1 of 1 (latest)
idk i dont know much about scripting
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)
maybe he clones it there for some reason
wat, no their whole code structure is wrong, i think they're trying to find a cloned copy of the key but aren't sure how to do it
so they compare to the one in storage "somehow"
** You are now Level 10! **
well you should probably close up this thread then
you would need waitforchild for a clickdetector prettysure, but not for chains of models/folders/etc anything that is a container
yeah doing multiple WaitForChilds just increases the width of the line real fast which goes against readability
Yeah but like, is putting .Something after waitforchild or findfirstchild or wtv really that bad as I make myself believe it is
or just make the model atomic and you only need to waitforchild on the model
I mean depends on the line width imo
that's what you really care about
cause it gives me the ick when someone types
local this = workspace:WaitForChild("this").Value
that's not bad imo
idk, i dont like this