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: I've searched far and wide for a melee script.

Previous Thread :: Next Thread 
PsychicLego is not online. PsychicLego
Joined: 27 Jul 2008
Total Posts: 4132
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
Mathman314 is not online. Mathman314
Joined: 31 Jul 2009
Total Posts: 556
22 Jun 2012 06:42 PM
...keep searching.
Report Abuse
PsychicLego is not online. PsychicLego
Joined: 27 Jul 2008
Total Posts: 4132
22 Jun 2012 06:44 PM
Four years of searching is long enough.
Report Abuse
Spectrumw is not online. 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
PsychicLego is not online. PsychicLego
Joined: 27 Jul 2008
Total Posts: 4132
22 Jun 2012 06:52 PM
Doesn't matter what went on before. I'm asking now.
Report Abuse
Spectrumw is not online. 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
PsychicLego is not online. PsychicLego
Joined: 27 Jul 2008
Total Posts: 4132
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 is not online. 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
PsychicLego is not online. PsychicLego
Joined: 27 Jul 2008
Total Posts: 4132
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 is not online. are31
Joined: 09 Nov 2007
Total Posts: 13767
22 Jun 2012 08:50 PM
hey its

Workspace.PhysicLego["Right Arm"].CFrame
Report Abuse
are31 is not online. are31
Joined: 09 Nov 2007
Total Posts: 13767
22 Jun 2012 08:51 PM
Workspace.Player["Right Arm"].CFrame = CFrame.new()
Report Abuse
PsychicLego is not online. PsychicLego
Joined: 27 Jul 2008
Total Posts: 4132
22 Jun 2012 09:16 PM
That didn't work either. Is CFrame the right thing to be using?
Report Abuse
WhiteRain is not online. 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
PsychicLego is not online. PsychicLego
Joined: 27 Jul 2008
Total Posts: 4132
22 Jun 2012 09:33 PM
That... doesn't work either...
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
22 Jun 2012 09:34 PM
Are you testing this in Solo or Online?
Report Abuse
PsychicLego is not online. PsychicLego
Joined: 27 Jul 2008
Total Posts: 4132
22 Jun 2012 09:40 PM
Testing in Solo. Why?
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
22 Jun 2012 09:42 PM
HopperBin or Tool?
Report Abuse
PsychicLego is not online. PsychicLego
Joined: 27 Jul 2008
Total Posts: 4132
22 Jun 2012 09:44 PM
HopperBin.
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
22 Jun 2012 09:46 PM
Idk then. :@
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
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
PsychicLego is not online. PsychicLego
Joined: 27 Jul 2008
Total Posts: 4132
22 Jun 2012 09:48 PM
I can't even get it to print "Hello world!" when I press "E" :|
Report Abuse
robotmega is not online. 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 is not online. 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
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
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
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
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
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