|
| 25 Aug 2016 08:51 AM |
Hi I'm new to scripting and I was wondering how to create a script so that a door would be locked, until the player/players found the key to unlock the door. Thanks for reading!
-Funky |
|
|
| Report Abuse |
|
|
Objectly
|
  |
| Joined: 18 Jul 2016 |
| Total Posts: 210 |
|
|
| 25 Aug 2016 08:53 AM |
--> Make a script that requires a key to open door --> Player must find key, make key go in backpack --> if player:HasKey() then player:CanOpenDoor end --> Go to the roblox wiki page for educational purposes. |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Aug 2016 09:08 AM |
Objectly that is not how the script works local player = game.Players.LocalPlayer local door = game.Workspace.Door door.Touched:connect(function(part) local humanoid = part.Parent:FindFirstChild('Humanoid') if humanoid then if player.Backpack:FindFirstChild('Key') then door.CanCollide = fasle end end end) |
|
|
| Report Abuse |
|
|