Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

i have no idea how CFrame works and this isnt working, help?

Asked by 4 years ago
Edited 4 years ago

im not sure what im doing i suck at scripting

i have been working on this for hours and i think im going crazy

its a down only door, example:(Close.Value = 1 then Door goes down to close hallway)

so anyone please help

thanks

also heres the script

local sp = script.Parent
local door = sp.door


if workspace.GameData.Close.Value == 1 then
    for i=1,door.Size.x/.2*3+1 do 
        door.CFrame = door.CFrame*CFrame.new(0,-.2*.2,0)
        door.Close:Play()

    end
end
0
What are you trying to do to the door's cframe? are you trying to rotate it open/closed? royaltoe 5144 — 4y

1 answer

Log in to vote
0
Answered by
Benbebop 1049 Moderation Voter
4 years ago
Edited 4 years ago

CFrame is a way of storing data (Ex. 3D Coordinates) so that stuff like positions can use it. Its used as follows:

door.position = CFrame.new(0,0,0)

This places the door at the coordinates 0, 0, 0.

Though it seems you are looking for TweenService as well which can add transitions to moving stuff.

For more information see CFrame and TweenService

0
*general confusion* RYANGAMES11 17 — 4y
Ad

Answer this question