So basically im trying to get the part position and then get the part position later in the script…
No idea what im doing but here is the code:
local garageDoor = script.Parent
local clickDetector = script.Parent.ClickDetector
local DEBOUNCE = false
local OPEN = false
local amount = 1
local doorOpenSound = script.Parent.DoorOpen
local doorClosedSound = script.Parent.DoorClose
--getting the open position
local openSize = game.Workspace.SmallHouse.GarageDoorModel.PositionOpen.Size
local openPosition = game.Workspace.SmallHouse.GarageDoorModel.PositionOpen.Position
--getting the closed position
local closeSize = game.Workspace.SmallHouse.GarageDoorModel.PositionClosed.Size
local closePosition = game.Workspace.SmallHouse.GarageDoorModel.PositionClosed.Position
clickDetector.MouseClick:Connect(function()
if not DEBOUNCE then
DEBOUNCE = true
if not OPEN then
OPEN = true
doorOpenSound:Play()
--putting the open position in the vector3 (Doesnt do anything)
garageDoor.Size = Vector3.new(openSize)
garageDoor.Position = Vector3.new(openPosition)
else
OPEN = false
doorClosedSound:Play()
--putting the closed position in the vector3 (Doesnt do anything)
garageDoor.Size = Vector3.new(closeSize)
garageDoor.Position = Vector3.new(closePosition)
end
task.wait(amount)
DEBOUNCE = false
end
end)