ADULTSWlM
|
  |
| Joined: 25 Jul 2011 |
| Total Posts: 465 |
|
|
| 23 Aug 2011 04:51 PM |
Here it is: bin = script.Parent Tool = script.Parent; function getjoint() player = bin.Parent char = player if char ~= nil then torso = char:FindFirstChild("Torso") if torso~= nil then joint = torso:FindFirstChild("Right Shoulder") if joint~=nil then return joint end end end return nil end
function getarm() player = bin.Parent char = player if torso~= nil then arm = char:FindFirstChild("Right Arm") if arm~=nil then return arm end end return nil end
function pointarmto(t, a, p, c0, c1) mid = (t.CFrame*CFrame.new(c0)).p --offset position dir = (mid - p).unit rot = CFrame.fromEulerAnglesXYZ(math.pi/2, 0, 0) rightangle = CFrame.fromEulerAnglesXYZ(0, 0, math.pi) off = CFrame.new(c1) a.CFrame = CFrame.new(mid, mid+dir)*rot*off*rightangle end
function Bob(mouse) while sel do wait(0.01) joint = getjoint() local c0 = nil local c1 = nil if joint~= nil then c0 = joint.C0.p -- center of arm c1 = joint.C1.p arm = getarm() arm.Anchored = true torso = joint.Part0 joint.Part1 = nil -- detach arm pointing = true point = mouse.Hit.p pointarmto(torso, arm, point, c0, c1) end end end
function FreddyBobson(mouse) sel = true Bob(mouse) end
script.Parent.Equipped:connect(FreddyBobson) sel = true Bob()
function Desel(mouse) joint = getjoint() arm = getarm() joint.Part1 = arm arm.Anchored = false sel = false end
script.Parent.Deequipped:connect(Desel)
And the output says that Line 53 was attempting a local 'mouse' (a nil value) or where you see "point=mouse.Hit.p"
Can you fix it?
|
|
|
| Report Abuse |
|
|
| |
|
ADULTSWlM
|
  |
| Joined: 25 Jul 2011 |
| Total Posts: 465 |
|
|
| 23 Aug 2011 04:55 PM |
| Just find the part that says "point=mouse.Hit.p" |
|
|
| Report Abuse |
|
|
ADULTSWlM
|
  |
| Joined: 25 Jul 2011 |
| Total Posts: 465 |
|
| |
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 23 Aug 2011 04:59 PM |
| I'm not fixing free models. |
|
|
| Report Abuse |
|
|
ADULTSWlM
|
  |
| Joined: 25 Jul 2011 |
| Total Posts: 465 |
|
|
| 23 Aug 2011 05:00 PM |
| So? At least help me of what's the problem with this free modeled script? |
|
|
| Report Abuse |
|
|