|
| 15 Nov 2011 07:15 PM |
how would i know what direction to fire the the parts based on which direction the bottom surface of my Right Arm is facing?
heres what i have so far...
local master = game.Players.LocalPlayer script.Parent.Selected:connect(function(mouse)
mouse.MouseDown:connect(function() local stream = Instance.new("Part",master.Character) game:GetService("Debris"):AddItem(stream,5) stream.CFrame = master.Character["Right Arm"].CFrame -- ??? stream.Velocity = Vector3.new(?,?,?) -- ?? end)
mouse.MouseUp:connect(function() print("Stopped")
end) end) end) |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2011 07:17 PM |
master.Character["Right Arm"].CFrame * CFrame.Angles(math.pi/2,0,0)
i think that would work |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2011 07:39 PM |
| thanks, one other problem... i keep getting an error that says MouseDown is not a valid member of mouse... am i doing it wrong? |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2011 07:41 PM |
| the events for the left mouse button getting clicked are Button1Down and Button1Up (choose one) |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2011 07:42 PM |
| http://wiki.roblox.com/index.php/MouseDown_%28Method%29 :o? |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2011 07:44 PM |
"method" "in object: dragger"
why would that apply here |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2011 07:45 PM |
| oh, lol i feel dumb now. :P |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 15 Nov 2011 07:57 PM |
Use the components of the rotation matrix.
http://www.roblox.com/item.aspx?setItemId=6655674&avID=137141227 |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2011 08:09 PM |
ok, yet another problem... i want the script to stop firing bricks when Button1Up fires, but it doesn't seen to do so... (i had a much simpler approach, but it failed...)
local master = game.Players.LocalPlayer local active = false
function fire() for i = 1,30 do wait(0.3) if active == false then break end local stream = Instance.new("Part",master.Character) game:GetService("Debris"):AddItem(stream,5) stream.CFrame = master.Character["Right Arm"].CFrame * CFrame.Angles(math.pi/2,0,0) stream.Velocity = Vector3.new(100,0,0) stream.CanCollide = false stream.Size = Vector3.new(1,1,1) end end fired = coroutine.create(fire)
script.Parent.Selected:connect(function(mouse) mouse.Button1Down:connect(function() coroutine.resume(fired) active = true
end)
mouse.Button1Up:connect(function() active = false coroutine.yield(fired) print("Stopped") end)
end) |
|
|
| Report Abuse |
|
|