I love weather, so I am making a weather script for my personal place. I built some "clouds" and trying to script them to fly over head. I have no clue what to do with Cframe. (I build with Cframe Tools) But I don't know how to script with it. What I got so far is:
wait (5) Workspace.Cloud1.part.CFrame = CFrame.new(0, 50, 0) wait (5) Workspace.Cloud1.part.CFrame = CFrame.new(0, 50, 0) wait (5) Workspace.Cloud1.part.CFrame = CFrame.new(0, 50, 0)
Now. I know I have to change new based on my current location. But I do no know how to do that. Also when I move it. It loses its tilt. Any way to keep that?
(Any and all help will be greatly heeded, Please don't try me to copy a script. I am here to learn lua not copy and paste.)
Best way to do this is by inserting a new instance of BodyVelocity
into the parts. Basically, it will move the part much like a cloud if you will. Remember that Vector3 represents location, while CFrame represents rotation values. Here is a quick code, though it's not tested.
cloud = script.Parent move = Instance.new("BodyVelocity") move.Parent = cloud while cloud do cloud.BodyVelocity.velocity = Vector3.new(2, 0, 0) wait(2) cloud.BodyVelocity.velocity = Vector3.new(2, 0, 0) end
I'm also new to Lua, so if there's any problems, please reply and I'll be happy to help.
~Kyo-chan
wait (5) Workspace.Cloud1.part.position = poisition.new(0, 50, 0) wait (5) Workspace.Cloud1.part.position = position.new(0, 50, 0) wait (5) Workspace.Cloud1.part.position = position.new(0, 50, 0)
Position and rotation also help really well.