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: Fix this script? :)

Previous Thread :: Next Thread 
konichiwah89 is not online. konichiwah89
Joined: 12 Dec 2010
Total Posts: 374
24 Sep 2011 10:05 AM
Okay, heres what I want.

. The person named (Me) To be killed by the brick on touch.

. The damage to be full, (Max damage)


heres the script


-Function OnHumanoidTouch(konichiwah89) <-- I want it to damage me only.

local humanoid.Maxdamage <-- I want this part ot kill me.

end
end
Report Abuse
konichiwah89 is not online. konichiwah89
Joined: 12 Dec 2010
Total Posts: 374
24 Sep 2011 10:05 AM
I want this part "To" Kill me

Typo, My bad.
Report Abuse
nike6330 is not online. nike6330
Joined: 11 Feb 2009
Total Posts: 154
24 Sep 2011 10:07 AM
function Touch(part)
if part.Parent.Name == "YourName" then
part.Parent:findFirstChild("Humanoid"):TakeDamage(damage)
end
end
script.Parent.Touched:connect(Touch)

..I think that was hidden request hmm
Report Abuse
konichiwah89 is not online. konichiwah89
Joined: 12 Dec 2010
Total Posts: 374
24 Sep 2011 10:08 AM
Well, isn't this the script requesting area?


I'm only a beginner at scripting, D=
Report Abuse
joshrocks101 is not online. joshrocks101
Joined: 07 Jun 2011
Total Posts: 1712
24 Sep 2011 10:08 AM
function onTouch(hit)
p = game.Players
if p.Name == ("konichiwah89") then
hit.Parent.Humanoid.Health = 0
end

script.Parent.Touched:connect(onTouch)

That should work.But i'm not completley sure.
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
24 Sep 2011 10:09 AM
I'm not a fan of requests..

However, this is quite easy.


local db = true
local targ = "konichiwah89"
script.Parent.Touched:connect(function(h)
if not db then return end
db = false
if h.Name ~= targ then return end
h:BreakJoints()
wait(2)
db = true
end)
Report Abuse
Ender1234 is not online. Ender1234
Joined: 21 May 2011
Total Posts: 28
24 Sep 2011 10:09 AM
You should try something like this:

function onTouched(hit)
if (hit.Parent.Humanoid ~= nil) and (hit.Parent.Name == "konichiwah89") then
hn = hit.Parent:FindFirstChild("Humanoid")
hn.Health = --desired health level here--
else
return
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
24 Sep 2011 10:09 AM
Gah, h.Parent..

local db = true
local targ = "konichiwah89"
script.Parent.Touched:connect(function(h)
if not db then return end
db = false
if h.Parent.Name ~= targ then return end
h.Parent:BreakJoints()
wait(2)
db = true
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