|
| 22 Jun 2012 06:40 PM |
But sadly, my searches are futile. I only have a vague idea of how scripting in Roblox works, so I can't make my own scripts.
When I press the E key, I want the right arm of the robloxian to move upwards and damage another robloxian, assuming there is one.
How do I make this a reality? |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Jun 2012 06:44 PM |
| Four years of searching is long enough. |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 22 Jun 2012 06:47 PM |
"Four years of searching is long enough."
If you had started learning how to do it yourself instead of wasting your time looking for one, you wouldn't need our 'help' right now. |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 06:52 PM |
| Doesn't matter what went on before. I'm asking now. |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 22 Jun 2012 06:56 PM |
http://wiki.roblox.com/index.php/Tool http://wiki.roblox.com/index.php/Mouse http://wiki.roblox.com/index.php/Cframe http://wiki.roblox.com/index.php/RBX.lua.Motor6D_(Object) http://wiki.roblox.com/index.php/KeyDown_(Event) http://wiki.roblox.com/index.php/Touched_(Event)
n_n you can find anything that you will possibly need to use in these articles. |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 08:28 PM |
local function onKeyDown("e") Workspace.Player.Right Arm.CFrame = CFrame.new(0,50,0) end mouse.KeyDown:connect(onKeyDown)
Okay, that's what I have so far, but when I press "E", nothing happens. what do I need to do to correct this? |
|
|
| Report Abuse |
|
|
1pie23
|
  |
| Joined: 11 Jul 2010 |
| Total Posts: 1865 |
|
|
| 22 Jun 2012 08:40 PM |
function onKeyDown(key) if key == "e" then Workspace.Player.Right Arm.CFrame = CFrame.new(0,50,0) end end mouse.KeyDown:connect(onKeyDown)
|
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 08:42 PM |
| Thanks, but it doesn't seem to work with that either. Am I getting the name for the arm wrong? |
|
|
| Report Abuse |
|
|
are31
|
  |
| Joined: 09 Nov 2007 |
| Total Posts: 13767 |
|
|
| 22 Jun 2012 08:50 PM |
hey its
Workspace.PhysicLego["Right Arm"].CFrame |
|
|
| Report Abuse |
|
|
are31
|
  |
| Joined: 09 Nov 2007 |
| Total Posts: 13767 |
|
|
| 22 Jun 2012 08:51 PM |
| Workspace.Player["Right Arm"].CFrame = CFrame.new() |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 09:16 PM |
| That didn't work either. Is CFrame the right thing to be using? |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 22 Jun 2012 09:24 PM |
function onKeyDown(key) if key == "e" then Workspace.Player["Right Arm"].CFrame = CFrame.new(0, 50, 0) end end mouse.KeyDown:connect(onKeyDown) |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 09:33 PM |
| That... doesn't work either... |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 22 Jun 2012 09:34 PM |
| Are you testing this in Solo or Online? |
|
|
| Report Abuse |
|
|
| |
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
| |
|
| |
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
| |
|
|
| 22 Jun 2012 09:47 PM |
function onKeyDown(key)
if (key == "e") then Workspace.Player.Torso["Right Shoulder"].C0 = Workspace.Player.Torso["Right Shoulder"].C0 * CFrame.Angles(0,0,0) end end
mouse.KeyDown:connect(onKeyDown)
Change the angles...
(x,y,z) (right, up, forward) |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 09:48 PM |
| I can't even get it to print "Hello world!" when I press "E" :| |
|
|
| Report Abuse |
|
|
robotmega
|
  |
| Joined: 16 May 2009 |
| Total Posts: 14084 |
|
|
| 22 Jun 2012 09:48 PM |
function onKeyDown(key) if key:lower() == "e" then game.Workspace.Player["Right Arm"].CFrame = CFrame.new(0, 50, 0) end end mouse.KeyDown:connect(onKeyDown) |
|
|
| Report Abuse |
|
|
RawrBot
|
  |
| Joined: 22 Aug 2008 |
| Total Posts: 832 |
|
|
| 22 Jun 2012 09:51 PM |
http://wiki.roblox.com/index.php/RBX.lua.Motor6D_(Object) http://wiki.roblox.com/index.php/Welds http://wiki.roblox.com/index.php/Weld
I would suggest editing the Motor6D. It is a weld that connects the limbs to the Torso, I think. So you can make the arm move around realistically around the joint. |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 09:51 PM |
function onKeyDown(key)
end
mouse.KeyDown:connect(function (key) onKeyDown(key) end)
FOUND ERROR! This migh work for yah with my script :3 |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 09:51 PM |
You have to define mouse.
hop = script.Parent
function onKeyDown(key) if key:lower() == "e" then game.Workspace.Player["Right Arm"].CFrame = CFrame.new(0, 50, 0) end end
hop.Selected:connect(function(mouse) mouse.KeyDown:connect(onKeyDown) end) |
|
|
| Report Abuse |
|
|