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 havent bin here for awhile....

Previous Thread :: Next Thread 
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
27 Aug 2011 09:20 AM
and it seems i cant get this super simple script to work. Alt: MyEpicBacon.
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
27 Aug 2011 09:20 AM
Do I need magic to see it? :o

~ I fail, You win. Life is harsh like that. ~
Report Abuse
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
27 Aug 2011 12:13 PM
bump
Report Abuse
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
27 Aug 2011 12:13 PM
oops i forgot to put it.
function ot(hit)
if (script.Parent.hit.Parent:findFirstChild(Humanoid)~=nil) then
script.Parent.hit.Parent.Humanoid.Health = 50
end
end


script.Parent.Touched:connect(ot)
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
27 Aug 2011 12:16 PM
hit is not a valid member of Part.
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
27 Aug 2011 12:17 PM
function ot(hit)
local Hum = hit.Parent:findFirstChild("Humanoid")
if Hum then
Hum.Health = 50
end
end


script.Parent.Touched:connect(ot)
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
27 Aug 2011 12:19 PM
script.Parent.Touched:connect(function (t)
if t.Parent:FindFirstChild("Humanoid") then
t.Parent.Humanoid.Health = 50
end end)

Shortest script :D
Report Abuse
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
27 Aug 2011 12:20 PM
Ok. it works now. thanks. I should of stayed lol. i
Report Abuse
bloob827 is not online. bloob827
Joined: 01 Aug 2010
Total Posts: 6867
27 Aug 2011 12:23 PM
@Pre

script.Parent.Touched:connect(function(s)pcall(function()game.Players:GetPlayerFromCharacter(s.Parent).Humanoid.Health=50 end)end)
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
27 Aug 2011 12:25 PM
@Bloob: uhhh, Humanoid is not a valid member of Player.

script.Parent.Touched:connect(function (t)
pcall(function() t.Parent.Humanoid.Health = 50 end)
end)
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
27 Aug 2011 12:35 PM
I just made it the way he did :T
Report Abuse
bloob827 is not online. bloob827
Joined: 01 Aug 2010
Total Posts: 6867
27 Aug 2011 12:37 PM
z0mg
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