-
What do you want to achieve? Keep it simple and clear!
I want to achieve a blast door that goes up when you press a button, and after 3 seconds the blast door goes back down. -
What is the issue? Include screenshots / videos if possible!
Basically what happens is that instead of delaying to go in reverse and the part going back to its original position, there is no delay and it immediatly happens. -
What solutions have you tried so far?
None so far, just makig a post here.
Code:
local click=script.Parent
local tweenservice=game.TweenService
local cooldown=false
local part=game.Workspace.BlastDoor
local pos=Vector3.new(994.629, 12.635, 714.405)
click.MouseClick:Connect(function(plr)
if cooldown==false and game.Workspace.DoorOpen.Value==false then
cooldown=true
game.Workspace.DoorOpen.Value=true
local tweeninfo=TweenInfo.new(
5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
2,
true,
3
)
local tween=tweenservice:Create(part, tweeninfo,{Position=pos})
tween:Play()
wait(5)
cooldown=false
game.Workspace.DoorOpen.Value=true
end
end)```
Yes I know the code is super sloppy and inneficient