sb901
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 6 |
|
|
| 19 Sep 2012 03:42 PM |
I want the brick to face the torso every time, but I'm not sure ho to write that correctly.
while true do wait(0.3) g=game.Players:GetChildren() for i = 1, #g do x=g[i].Character.Torso.Position.X y=g[i].Character.Torso.Position.Y z=g[i].Character.Torso.Position.Z p=Instance.new("Part",g[i].Character.Torso) p.Size=Vector3.new(4,1,10) p.CFrame=CFrame.new(x,y-3.5,z) * CFrame.Angles(math.rad(0),math.rad(tostring(g[i].Character.Torso.CFrame.lookVector),math.rad(0))) p.Anchored=true p.BrickColor=BrickColor.Random() p.Material="Ice" end end
Output: 16:40:18.534 - Workspace.Script:10: bad argument #1 to 'rad' (number expected, got string) 16:40:18.535 - Script "Workspace.Script", Line 10 16:40:18.536 - stack end |
|
|
| Report Abuse |
|
|
|
| 19 Sep 2012 03:53 PM |
| math.rad is only for the x value. |
|
|
| Report Abuse |
|
|
|
| 19 Sep 2012 03:53 PM |
Lolololol fail.
~squiggy fail~ |
|
|
| Report Abuse |
|
|
sb901
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 6 |
|
|
| 19 Sep 2012 03:58 PM |
| Do you know how to fix it? |
|
|
| Report Abuse |
|
|
sb901
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 6 |
|
| |
|
sb901
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 6 |
|
| |
|
|
| 19 Sep 2012 04:33 PM |
@MonkeyForBananas
math.rad() means radians. Because...
2(3.1415) is 360 degrees.
3.1415 is 180 degrees. But let's say you didn't know that. What would we do, you would use math.rad() to convert numbers to radians. Example:
block.CFrame=CFrame.Angles(math.rad(90),math.rad(90),math.rad(90))
That will rotate it 90 degrees each way, BUT you could ALSO do this:
block.CFrame=CFrame.Angles(3.1415/2,3.1415/2,3.1415/2)
Which would give Pi/2
which is 1.5707
-> Siggy pooped by the power of Ponies <- |
|
|
| Report Abuse |
|
|
sb901
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 6 |
|
|
| 19 Sep 2012 04:37 PM |
| Can someone please help me fix this? |
|
|
| Report Abuse |
|
|
sb901
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 6 |
|
| |
|