Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 23 Jun 2016 05:36 AM |
is there a script to make a MODEL turn in rotations, 360 degree or so, without stopping ofcourse (not union, the whole model, and not the parts one by one).
I have a script, but it only like works on 1 part/union, I want to make the whole model turn, please |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
| |
|
pullman45
|
  |
| Joined: 09 Jul 2012 |
| Total Posts: 2891 |
|
|
| 23 Jun 2016 06:43 AM |
| Set the PrimaryPart of the model to the part that you want to rotate and then the whole thing should rotate. |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 07:00 AM |
Model.PrimaryPart = Model["blue part"] while wait() do Model:SetPrimaryPartCFrame(Model.PrimaryPart * CFrame.Angles(.1,0,0)) Model:SetPrimaryPartCFrame(Model.PrimaryPart * CFrame.Angles(0,.1,0)) end |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 07:05 AM |
local Model = Instance.new("Model") Model.Parent = workspace
local Part1 = Instance.new("Part") local Part2 = Instance.new("Part") local Part3 = Instance.new("Part") local Part4 = Instance.new("Part") local Part5 = Instance.new("Part") Part1.Anchored = true Part2.Anchored = true Part3.Anchored = true Part4.Anchored = true Part5.Anchored = true Part1.Size = Vector3.new(4, 1, 2) Part2.Size = Vector3.new(5.25, 1, 2) Part3.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003) Part4.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003) Part5.Size = Vector3.new(0.200000003, 0.200000003, 0.75999999) Part1.CFrame = CFrame.new(-6.19999981, 0.500003994, -11.6000004, 1, 0, 0, 0, 1, 0, 0, 0, 1) Part2.CFrame = CFrame.new(-3.70499992, 1.30000007, -11.6000004, 1, 0, 0, 0, 1, 0, 0, 0, 1) Part3.CFrame = CFrame.new(-0.9799999, 1.39807189, -10.9149437, 1, 0, 0, 0, 1, 0, 0, 0, 1) Part4.CFrame = CFrame.new(-0.9799999, 1.41353703, -12.0956602, 1, 0, 0, 0, 1, 0, 0, 0, 1) Part5.CFrame = CFrame.new(-0.9799999, 1.14598835, -11.5141163, 1, 0, 0, 0, 1, 0, 0, 0, 1) Part1.Parent = Model Part2.Parent = Model Part3.Parent = Model Part4.Parent = Model Part5.Parent = Model
local Target = workspace.Model
local Cache = {} local Point = nil
local Children = Target:GetChildren() local Point = Children[math.random(1, #Children)]
for k,v in pairs(Children) do if v ~= Point then Cache[#Cache + 1] = {Obj = v, cf = Point.CFrame *v.CFrame:inverse()} end end
game:GetService("RunService").RenderStepped:connect(function() Point.CFrame = CFrame.new(0, 5, 0) *CFrame.Angles(tick()%360, 0, 0) *CFrame.new(0, 0, -2) for k,v in pairs(Cache) do v.Obj.CFrame = Point.CFrame *v.cf end end)
lol might be buggy tho but to give u idea it should work |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 23 Jun 2016 07:07 AM |
| k so I put down 2 parts, group them name the Model Model5 and change "Model" in script to "Model5", put the script into the model, and the script is in normal script not local, it doesn't work, tell me how ;-; |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 07:10 AM |
for i, v in pairs(Model5:GetChildren()) do --do what you like end
Waffles are good for you. |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
| |
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 23 Jun 2016 07:20 AM |
| @google, the script just creates two parts that move in a circle, in a wide one, I have a datacron, very small, I don't like want it to move, I just want it to TURN, without moving from it's place, just turn around up-down left-right |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
| |
|
|
| 23 Jun 2016 07:29 AM |
local function moveTarget(Object, Position) local Children = Object:GetChildren() local Cache = {} local Point = nil for k,v in pairs(Children) do if v.ClassName == "Part" then if not Point then Point = v else Cache[#Cache + 1] = { Object = v, DistanceFromPoint = Point.CFrame:inverse() *v.CFrame } end end end
Point.CFrame = Position -- If u dont want to move just add cframe then use Point.CFrame = Point.CFrame *Position for k,v in pairs(Cache) do v.Object.CFrame = Point.CFrame *v.DistanceFromPoint end end
-- aditional
game:GetService("RunService").RenderStepped:connect(function() moveTarget(workspace.Model, CFrame.new(0, 5 ,5) *CFrame.Angles(0, tick()%360, 0)) end) |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 23 Jun 2016 07:31 AM |
| do I just put it inside the model |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
| |
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
| |
|
|
| 23 Jun 2016 07:43 AM |
Here new code local function moveTarget(Object, Position, Point) local Children = Object:GetChildren() local Cache = {} local Point = Point for k,v in pairs(Children) do if v.ClassName == "Part" then if not Point then Point = v else Cache[#Cache + 1] = { Object = v, DistanceFromPoint = Point.CFrame:inverse() *v.CFrame } end end end
Point.CFrame = Position for k,v in pairs(Cache) do v.Object.CFrame = Point.CFrame *v.DistanceFromPoint end end
http://recordit.co/mYMQeOItM5 |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 23 Jun 2016 07:59 AM |
| sorry but I seriously didn't understand anything from that, I just created a script, put that script into it, then put the script into workspace created a Player1, I don't see anything different, and my purpose is to make a model turn around, 360 degrees, from left to right and up to down, not move it from place to place, it just has to turn around |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 08:07 AM |
aaaahh..
learn how function work and general scripting -_- |
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 23 Jun 2016 08:08 AM |
| please help me with this 1 :( |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 08:12 AM |
U need to rotate ur point so it has to be like this
local Point = Player1.Torso -- not typing workspace etc..
game:GetService("RunService").Heartbeat:connect(function() moveTarget(Player1, Point.CFrame * CFrame.Angles(0, tick()%360, 0), Point) end)
|
|
|
| Report Abuse |
|
|
Tsurra
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 495 |
|
|
| 23 Jun 2016 08:17 AM |
| can you just add it to the full script ;-; |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 08:38 AM |
learn how function work and general scripting -_- [2]
r+://393244197r+://393244224r+://393244262 |
|
|
| Report Abuse |
|
|