How to make a key door in Roblox Studio

Поділитися
Вставка
  • Опубліковано 16 січ 2025

КОМЕНТАРІ • 11

  • @heathergatewood6576
    @heathergatewood6576 20 днів тому +2

    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
    )

  • @nitrored
    @nitrored 13 днів тому

    please make this a series 🙏🙏🙏

  • @zgr2575
    @zgr2575  23 дні тому

    what tutorial do yall want next?

    • @Jam_n_Rae
      @Jam_n_Rae 20 днів тому

      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).

    • @heathergatewood6576
      @heathergatewood6576 20 днів тому

      you should make a mini map tutorial almost like the one in Fortnite

  • @Jakub-bg7cm
    @Jakub-bg7cm 20 днів тому

    You should explain what the script does exactly so people that want to learn can

    • @zgr2575
      @zgr2575  19 днів тому

      I tried to explain as best as I could. Thanks for the feedback!

  • @jackcaton7103
    @jackcaton7103 15 днів тому

    could you do the same function but with with a local script?

  • @heathergatewood6576
    @heathergatewood6576 20 днів тому +1

    also pls add copy and paste in comments or discription

    • @zgr2575
      @zgr2575  19 днів тому

      I linked the model with full code in the description!

    • @alecsspnm
      @alecsspnm 18 днів тому

      @@zgr2575Idk why but the model link does not work and its just like half of it