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

Can you CFrame with scripts? [closed]

Asked by 10 years ago

Hi, I wanna know how to CFrame with scripts. When you CFrame without scripts in my opinion, It isn't perfect. So how about CFraming with scripts. It'll probably be perfect. Not everything is perfect. Just like probably 80.9% will help. Designing games is all about the building and like 50% of it is CFramed. So can you CFrame with scripts?

Locked by JesseSong

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

3 answers

Log in to vote
1
Answered by 10 years ago

Yes. You can CFrame a parts position by doing the following.

Workspace.Part.CFrame = CFrame.new(0, 0, 0)  -- XYZ

You can CFrame the rotation

CFrame.Angles(number rx, number ry, number rz) -- r means in radians
Ad
Log in to vote
0
Answered by
jobro13 980 Moderation Voter
10 years ago

Yes. In fact, the CFraming you probably mean uses a GUI (Graphical User Interface) - probably a plugin - to help you move parts.

In fact, this is controlled by a script.

I have the idea that you haven't got into basic scripting yet. I suggest you get into basic scripting first before going to CFrames. CFraming isn't hard, but you will need a mathematical basis for it first, otherwise you will end up in - sometimes - endless "trail and error", which is not the way how you should do it.

0
I'm learning basic scripting by a friend, So I might get the hang of it. Roboy5857 20 — 10y
Log in to vote
0
Answered by 10 years ago
Edited by JesseSong 4 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

Depends on what the script is. If it was a part and your trying to weld it then it would be

variable = Instance.new("Weld")
variable.Part0 = --part of what you want it to be welded to
variable.Part1 = --the name of your part
variable.C0 = CFrame.new(0, 0, 0) * CFrame.fromEulerAngles(0, 0, 0) --If you want angles, but it dosent have to be just fromEulerAngles, it could be CFrame.Angles(0, 0, 0) and there is other C0's

there is C1 but that's all ive heard.