generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Locked Door Script

Previous Thread :: Next Thread 
FunkyFrank345 is not online. FunkyFrank345
Joined: 11 Mar 2012
Total Posts: 26
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 is not online. 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
FunkyFrank345 is not online. FunkyFrank345
Joined: 11 Mar 2012
Total Posts: 26
25 Aug 2016 08:54 AM
Thanks for the reply!
Report Abuse
WrightPhillips99 is not online. WrightPhillips99
Joined: 27 Jun 2015
Total Posts: 667
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image