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: Easy Problem...

Previous Thread :: Next Thread 
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
26 Aug 2011 06:22 AM
function Hit(hit)
local human = hit.Parent:FindFirstChild("Junk")
if human ~= nil then
human.Health = human.Health -15
end
end

larm.Touched:connect(Hit)
rarm.Touched:connect(Hit)

It won't work how come?
I edited/made it and it didnt work!! OMG
How come?
Report Abuse
NilPirate is not online. NilPirate
Joined: 31 Jul 2010
Total Posts: 3077
26 Aug 2011 06:25 AM
The game doesn't know what larm and rarm are yet.
Report Abuse
Staplers10 is not online. Staplers10
Joined: 09 Sep 2010
Total Posts: 409
26 Aug 2011 06:26 AM
I'm not sure if this will work, but:


local human = hit.Parent:FindFirstChild("Junk")

function Hit()
if human ~= nil then
human.Health = human.Health -15
end
end

script.Parent.Touched:connect(onTouch)


I'm sort of just a moderate scripter, but I can make useful scripts.
Report Abuse
NilPirate is not online. NilPirate
Joined: 31 Jul 2010
Total Posts: 3077
26 Aug 2011 06:27 AM
human = hit.Parent:FindFirstChild("Junk")

function Hit()
if human ~= nil then
human.Health = human.Health -15
end
end

script.Parent.Touched:connect(onTouch)

I'm pretty sure a local would make human out of scope for Hit()
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
26 Aug 2011 07:29 AM
thx...
Report Abuse
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
26 Aug 2011 07:30 AM
No, problem.
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
26 Aug 2011 07:32 AM
You didnt even help...xD
Report Abuse
verpy12 is not online. verpy12
Joined: 13 May 2010
Total Posts: 1737
26 Aug 2011 07:57 AM
That might work
Report Abuse
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
27 Aug 2011 06:19 PM
Miro, yes I did you liar! =3
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
27 Aug 2011 06:38 PM
What did you write? I don't see a post..
Report Abuse
bluepen16 is not online. bluepen16
Joined: 13 Nov 2008
Total Posts: 1870
27 Aug 2011 06:41 PM
local human = hit.Parent:FindFirstChild("Junk")
function Hit()
if human ~= nil then
human.Health = human.Health -15
end
end

script.Parent.Touched:connect(Hit)

If this doens't work I got nothing.
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
27 Aug 2011 06:57 PM
Ok guys I already figured it out..hx by the ways GUYS

========================THREAD ENDED=====================
Report Abuse
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
28 Aug 2011 12:40 PM
I like to shake my junk! =3
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
28 Aug 2011 02:16 PM
go ahead...Last post EVERYBODY!!
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