generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: projectiles?

Previous Thread :: Next Thread 
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
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
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
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
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
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
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
15 Nov 2011 07:41 PM
the events for the left mouse button getting clicked are Button1Down and Button1Up (choose one)
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
15 Nov 2011 07:42 PM
http://wiki.roblox.com/index.php/MouseDown_%28Method%29 :o?
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
15 Nov 2011 07:44 PM
"method"
"in object: dragger"

why would that apply here
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
15 Nov 2011 07:45 PM
oh, lol i feel dumb now. :P
Report Abuse
SDuke524 is not online. 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
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image