script: local doorPart = script.Parent local ttso = 2-- amount of time the door is open -- local keyName = "Key"-- name of the key required to open the door -- local function onTouch() doorPart.CanCollide = false doorPart.Transparency = .5 task.wait(ttso) doorPart.CanCollide = true doorPart.Transparency = 0 end local function validateKey(part) -- 1000 if part:IsA("BasePart") and part:FindFirstChild("Value") and part.Value:IsA("StringValue") then if part.Value.Value == keyName then onTouch() end end end doorPart.Touched:Connect(function(a) validateKey(a) end )
script: local doorPart = script.Parent
local ttso = 2-- amount of time the door is open --
local keyName = "Key"-- name of the key required to open the door --
local function onTouch()
doorPart.CanCollide = false
doorPart.Transparency = .5
task.wait(ttso)
doorPart.CanCollide = true
doorPart.Transparency = 0
end
local function validateKey(part)
-- 1000
if part:IsA("BasePart") and part:FindFirstChild("Value") and part.Value:IsA("StringValue") then
if part.Value.Value == keyName then
onTouch()
end
end
end
doorPart.Touched:Connect(function(a) validateKey(a) end
)
please make this a series 🙏🙏🙏
what tutorial do yall want next?
How to use debounce - Also when an part touched it deals 5 damage. (I would be thankful if it will be in the same video).
you should make a mini map tutorial almost like the one in Fortnite
You should explain what the script does exactly so people that want to learn can
I tried to explain as best as I could. Thanks for the feedback!
could you do the same function but with with a local script?
also pls add copy and paste in comments or discription
I linked the model with full code in the description!
@@zgr2575Idk why but the model link does not work and its just like half of it