Erielvictor / Meus-projetos

2 stars 0 forks source link

Gate #6

Open Erielvictor opened 1 year ago

Erielvictor commented 1 year ago
local TS = game:GetService("TweenService")
local Debounce = true
local Portao = script.Parent.Portao
local GreenButton = script.Parent.Greenbtn
local RedButton = script.Parent.RedBtn
local tween = TweenInfo.new(3, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out, 0, false, 0.3 )

GreenButton.ClickDetector.MouseClick:Connect(function()
    Debounce = false
    wait(1)
    TS:Create(Portao, tween, {Position = Vector3.new(-8.5, 17, -13)}):Play()
end)

RedButton.ClickDetector.MouseClick:Connect(function()
    Debounce = false
    wait(1)
    TS:Create(Portao, tween, {Position = Vector3.new(-8.5, 6, -13)}):Play()
end)
Erielvictor commented 1 year ago

This gate works with two buttons. Green to open. Red to close.