Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to make keybind keycard door?

Asked by 4 years ago

How to make keycard door when you click E then door open.

0
This isn't a request site and you can find Youtube tutorials for that and then modify the script for the open door function. N43FGXL 169 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Here is a keycard model you can use for free here: www.roblox.com/item.aspx?seoname=Key-Card-Door&id=495619656

The script for the door is here (and in the free model) :

--By mb10932 (2018)
02   
03   
04  Door = script.Parent --Where The Door Part Is 
05  Opentime = 1 -- How Long The Door Is Open For
06  Debounce = false --Stops The Door Being Opened More Than Once AT One Time
07   
08  script.Parent.Touched:connect(function(Part)
09      if Debounce ~= true then --Make Sure That The Door Is Not Already Open
10          Debounce = true --Sets The Variable Debounce To True So The Script Knows Not To Open It Again.
11          local keycard = Part:FindFirstChild("keycard")--Find The BoolValue keycard (in the tool handle)
12          if keycard ~= nil and keycard.Value == true then --Check That keyvale exists and its set to true
13              Door.Transparency = 1 --Set Door Transparency to 1
14              Door.CanCollide = false --Set CanCollide to false
15              wait(Opentime) --Wait For How Long The Variable Opentime Is Set For
16              Door.CanCollide = true --Set CanCollide to false
17              Door.Transparency = 0 --Set Door Transparency to 0
18          end --Ends The If Statement
19          Debounce = false --Set Debounce To False So The Door Can Be Opened Again.
20      end --Ends The If Statement
21  end) --Ends The Function
0
Thanks MatoProF 23 — 4y
0
np NotFrindow 346 — 4y
Ad

Answer this question