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: Why doesnt this work

Previous Thread :: Next Thread 
Subsidence is not online. Subsidence
Joined: 08 Jul 2013
Total Posts: 1665
27 Apr 2014 04:39 PM
local brick = Workspace.Brick

function onTouch(part)
Humanoid:TakeDamage(20)
end

brick.Touched:connect(onTouch) -- The line that connects the function to the event.

- Appa Yip Yip
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
27 Apr 2014 04:41 PM
"Humanoid:TakeDamage(20)"
Humanoid is undefined.
Report Abuse
Subsidence is not online. Subsidence
Joined: 08 Jul 2013
Total Posts: 1665
27 Apr 2014 04:42 PM
What do you mean by that?

- Appa Yip Yip
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
27 Apr 2014 04:44 PM
You haven't told the script what 'Humanoid' is, so the script assumes it's nothing.
Report Abuse
Subsidence is not online. Subsidence
Joined: 08 Jul 2013
Total Posts: 1665
27 Apr 2014 04:45 PM
How do I tell it then?

- Appa Yip Yip
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
27 Apr 2014 04:45 PM
local brick = game.Workspace.Brick
local Humanoid = game.Players.LocalPlayers.Humanoid

function onTouch(part)
Humanoid:TakeDamage(20)
end

brick.Touched:connect(onTouch)
Report Abuse
Subsidence is not online. Subsidence
Joined: 08 Jul 2013
Total Posts: 1665
27 Apr 2014 04:48 PM
Thank you

- Appa Yip Yip
Report Abuse
Subsidence is not online. Subsidence
Joined: 08 Jul 2013
Total Posts: 1665
27 Apr 2014 04:53 PM
This doesn't work

- Appa Yip Yip
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