#need help with scripting a door

1 messages · Page 1 of 1 (latest)

broken imp
#

I guys, i'm scripting a garage door that need to go from position in image 1 to image 2 when the sensor (the big transparent box) get touched by a player.
That is the code:

local tweenservice = game:GetService("TweenService")

local garagedoor = script.Parent.Parent

local base = garagedoor.BASE

local tweeninfo = TweenInfo.new(1.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)

local properties = {Position = Vector3.new(-1334.171, 14.748, 144.9), CFrame.Angles(math.rad(0, -90, -90))}

local tween = tweenservice:Create(base, tweeninfo, properties)

local sensor = garagedoor.sensor

sensor.Touched:Connect(function(otherPart)

tween:Play()

end)

and it do nothing, there's why i'm here.
also gonna upload an image with the folder that contain anything
The part called BASE is a part welded to all the other part of the garage door, and the BASE is anchored.
P.s. the script is contained in the BASE with all the welds

broken imp
#

i forgot to mention that i'm new to roblox studio

pale knot
#

is the garage door a model or a union or part?

broken imp
#

is not a model, its kinda strage cause all the part are in a forlder called garagedoor so i dont have all the part in the workspace or a model.

#

I tried to understand some youtube videos about tweening a model but nothing, my brain imploded when it not worked

brave willow
#
{Position = Vector3.new(-1334.171, 14.748, 144.9), CFrame.Angles(math.rad(0, -90, -90))}
#

what is going on here

#

this makes no sense

#

it would cause an error

broken imp
#

how can it be fixed?

#

cause i don't know what to use between Vector3 and CFrame