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: DontReadScript

Previous Thread :: Next Thread 
vincentfeathers is not online. vincentfeathers
Joined: 18 Sep 2010
Total Posts: 527
02 Apr 2013 07:39 PM
local player = game.Players.LocalPlayer

function onTouch(connect)
if player.Character.Head.Humanoid ~= nil then
player.Character.Head.Humanoid.Health = 0
end
end

script.Parent.Touched:connect(onTouch)

Support This: http://www.roblox.com/Forum/ShowPost.aspx?PostID=93640170
Report Abuse
noah is not online. noah
Joined: 11 Sep 2006
Total Posts: 18977
02 Apr 2013 07:42 PM
that argument in that function is useless since you defined player
Report Abuse
shawnyg is not online. shawnyg
Joined: 21 Apr 2011
Total Posts: 1428
02 Apr 2013 07:47 PM
You are trying to do a kill script I see. Use this instead

function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h ~= nil then
h.Health = 0
end
end


script.Parent.Touched:connect(onTouched)

Report Abuse
vincentfeathers is not online. vincentfeathers
Joined: 18 Sep 2010
Total Posts: 527
02 Apr 2013 07:52 PM
thanks.

Support This: http://www.roblox.com/Forum/ShowPost.aspx?PostID=93640170
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