Narutozo
|
  |
| Joined: 28 Jul 2013 |
| Total Posts: 1314 |
|
|
| 04 Jul 2015 06:54 AM |
i want to ADD CFrame not apply it Player = game.Players.LocalPlayer Mouse = Player:GetMouse() pathoff = false pathing = false
Mouse.KeyDown:connect(function(key)Mouse.KeyDown:connect(function(key) Key = key:lower() if key == "c" then P = Instance.new("Part") P.Parent = workspace P.Anchored = true P.Transparency = 0 P.FormFactor = 3 P.Size = Vector3.new(9,0.00001,9)
while Game:GetService("RunService").Heartbeat:wait() do P.CFrame = Player.Character.Torso.CFrame * CFrame.new(0,-5,0) P.TopSurface = "Smooth" P.BottomSurface = "Smooth" P.BrickColor = BrickColor.new("Really black") P.Material = "SmoothPlastic" wait(0.0000001)
spawn(function() for i = 1,2 do wait(0.0001) P.CFrame = P.CFrame * CFrame.Angles(0,math.rad(20),0) -- this applys cframe.. but it does not add cframe. wait(0.5) end end) end end end) end)
please post how to fix it with the fixed version below
|
|
|
| Report Abuse |
|
|
Narutozo
|
  |
| Joined: 28 Jul 2013 |
| Total Posts: 1314 |
|
| |
|
Narutozo
|
  |
| Joined: 28 Jul 2013 |
| Total Posts: 1314 |
|
| |
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
| |
|
Narutozo
|
  |
| Joined: 28 Jul 2013 |
| Total Posts: 1314 |
|
|
| 04 Jul 2015 07:12 AM |
| like i want it to add 20 degrees everytime. it sets it to 20 degrees not adding it to 20 degrees |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 04 Jul 2015 07:19 AM |
Ah, I see your problem.
Since you spawn()ed that part that changes the angle, the while loop will loop through once more. And since you added that tiny wait() in the spawn()ed function, that gives it time to set P.CFrame = Player.Character.Torso.CFrame * CFrame.new(0,-5,0).
And then the for loop inside the spawn()ed function will run again, only to be beaten by the while loop that'll reset P's CFrame. |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2015 07:35 AM |
"wait(0.0000001)" You can only wait for 0.03 seconds. wait() does the same thing. |
|
|
| Report Abuse |
|
|
Alyte
|
  |
| Joined: 24 Oct 2011 |
| Total Posts: 10090 |
|
|
| 04 Jul 2015 07:41 AM |
FALSE
you can wait 5 secs too |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
| |
|