Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

1 comment

0

What are you trying to do to the door's cframe? are you trying to rotate it open/closed?

1 answer

✓ Accepted answer

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

1 comment

0

general confusion

This discussion is preserved as it was. New answers, comments, and votes are closed.