Vault Door Test Game

This took a while but here’s a Vault Door Opening test game I made. [Don’t spam click the door]

4 Likes

That’s a really nice Vault Animation! Of course some things can be changed for feedback:

  • Add a opening gear sound indicating that the vault is opening (Unless if there was one, even still the alarm was pretty loud)

  • Adding a debounce (Or anti-spam) for clicking the vault is actually really simple, you can just check if the debounce is currently enabled or not to run more of its code

Other than that, great job!

1 Like

If I can figure out how to make it not loop and stay open it would be cool if I could make it play in reverse to make it look like its closing and locking. not a clue how though

I can give you an advice. I made what you want to achieve. What you need to do:

  1. Create Open Door Animation, Create Opened Idle Animation, Create close animation.
  2. Script the door, in the way like that:
script.Parent.MouseButtonClick:Connect(function()
if not opened then
openanim:Play()
wait(animlenght)
openIdle:Play()
end

Something like that.
Also you should disable the ClickDetector when opening.
9/10

Thanks. I still gotta learn how to make a debounce script for the ClickDetector and I might possibly do what you said.

You can disable the ClickDetector by putting its MaxActivationDistance to 0.

1 Like

I think that the vault it self looks fantastic. There is some room for improvement though such as.

-Making the vault door open from the side instead of up.

-Make it so you can only hit it once every so often to prevent it from breaking.

-The alarms doesn’t really fit with a vault I really just imagine more mechanical parts moving and the door slowly swinging open

-I think the alarm is a bit to loud aswell.

I hope my feedback helped with your project the vault it self looks very good I would just focus on the things I stated to make it a bit better.

so I got this code now and it works for opening and idle open but idk how to make it run the closing animations.

local Opening = script.Parent.AnimationController:LoadAnimation(script.Parent.Opening)
local Opening_Idle = script.Parent.AnimationController:LoadAnimation(script.Parent.Opening_Idle)
local Closing = script.Parent.AnimationController:LoadAnimation(script.Parent.Closing)
local Closing_Idle = script.Parent.AnimationController:LoadAnimation(script.Parent.Closing_Idle)

local clickDetector = workspace.FBXImportGeneric.ClickDetector

function onMouseClick()
script.Parent.ClickDetector.MaxActivationDistance = 0
Opening:Play()
wait(19.8)
script.parent.ClickDetector.MaxActivationDistance = 32
Opening_Idle:Play()

end

clickDetector.MouseClick:connect(onMouseClick)

Sorry for the late reply. Try this code:

local Opening = script.Parent.AnimationController:LoadAnimation(script.Parent.Opening)
local Opening_Idle = script.Parent.AnimationController:LoadAnimation(script.Parent.Opening_Idle)
local Closing = script.Parent.AnimationController:LoadAnimation(script.Parent.Closing)
local opened = false
local clickDetector = script.Parent

clickDetector.MouseClick:Connect(function()
if not opened then
opened = true
clickDetector.MaxActivationDistance = 0
Opening:Play()
wait(19.8)
Opening_Idle:Play()
clickDetector.MaxActivationDistance = 32
else
opened = false
Opening_Idle:Stop()
clickDetector.MaxActivationDistance = 0
Closing:Play()
wait(19.8)
clickDetector.MaxActivationDistance = 32

end)

This should work :+1:

When I change out the script with yours the animation does not start.

I am not on computer. Maybe change the MouseClick function or something