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: Quick fix Please <-- Help

Previous Thread :: Next Thread 
firesorccer1 is not online. firesorccer1
Joined: 27 Feb 2009
Total Posts: 1504
09 Dec 2009 09:49 AM
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
local c = part.Parent:findFirstChild("Body Colors")
if h~=nil and if c~=nil then

h.Health = h.Health -10
wait(1)
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
gustav165 is not online. gustav165
Joined: 11 Nov 2008
Total Posts: 1981
09 Dec 2009 09:52 AM
Whats the problem?
Report Abuse
firesorccer1 is not online. firesorccer1
Joined: 27 Feb 2009
Total Posts: 1504
09 Dec 2009 09:55 AM
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
local c = part.Parent:findFirstChild("Body Colors")
if h~=nil and if c~=nil then -- do i have the lines positioned right?

h.Health = h.Health -10
wait(1)
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
gustav165 is not online. gustav165
Joined: 11 Nov 2008
Total Posts: 1981
09 Dec 2009 09:56 AM
No you don't.
You cant start a new if on an if statement O.o
Fix:
if h~=nil and c~=nil then
Report Abuse
firesorccer1 is not online. firesorccer1
Joined: 27 Feb 2009
Total Posts: 1504
09 Dec 2009 10:05 AM
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
local c = part.Parent:findFirstChild("Body Colors")
if h~=nil and c~=nil then

h.Health = h.Health -10
wait(1)
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
firesorccer1 is not online. firesorccer1
Joined: 27 Feb 2009
Total Posts: 1504
09 Dec 2009 10:06 AM
Ty and is there a way to tell if its a player not a zombie?

I feel kinda noobie makin' a zombie game but oh well
Report Abuse
RightLegRed is not online. RightLegRed
Joined: 02 Oct 2009
Total Posts: 6761
09 Dec 2009 10:13 AM
Well most the time the Humanoid in a zombie is called "Zombie".
Report Abuse
firesorccer1 is not online. firesorccer1
Joined: 27 Feb 2009
Total Posts: 1504
09 Dec 2009 10:16 AM
No RLR EVRY TIME i post this you say that.
Its My Zombie
Not Cruddy Free model
Report Abuse
firesorccer1 is not online. firesorccer1
Joined: 27 Feb 2009
Total Posts: 1504
09 Dec 2009 10:17 AM
+ all of my guns wouldnt work if i changed the name



Or could i put a bool value in the zombie and if the (hit) brick has that then damage - 0
Report Abuse
RightLegRed is not online. RightLegRed
Joined: 02 Oct 2009
Total Posts: 6761
09 Dec 2009 10:18 AM
I've said that once, I don't think i've ever said that sentence before in my life.

So, now. Take my advice and rename the Humanoid "Zombie".
Report Abuse
firesorccer1 is not online. firesorccer1
Joined: 27 Feb 2009
Total Posts: 1504
09 Dec 2009 10:19 AM
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
local c = part.Parent:findFirstChild("Zomb") -- Zomb is a value in every zombie
if h~=nil and c=nil then -- if c is really not there then

h.Health = h.Health -10 ---10
wait(1)
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
firesorccer1 is not online. firesorccer1
Joined: 27 Feb 2009
Total Posts: 1504
09 Dec 2009 10:20 AM
No!
Then my hole place will be unplayuble
Report Abuse
firesorccer1 is not online. firesorccer1
Joined: 27 Feb 2009
Total Posts: 1504
09 Dec 2009 10:24 AM
Well would this work RLR

function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
local c = part.Parent:findFirstChild("Zomb") -- Zomb is a value in every zombie
if h~=nil and c=nil then -- if c is really not there then

h.Health = h.Health -10 -- then -10
wait(1)
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
RightLegRed is not online. RightLegRed
Joined: 02 Oct 2009
Total Posts: 6761
09 Dec 2009 10:24 AM
Or you'nno the script in the weapons, at the same place as the finding Humanoid part, you can add "or if hit.Parent:FindFirstChild("Zombie") then"


Report Abuse
firesorccer1 is not online. firesorccer1
Joined: 27 Feb 2009
Total Posts: 1504
09 Dec 2009 10:28 AM
my gun scripts
30 guns/staffs/blasters

have (off teh top of head)

if hit == findFirstChild("Zomb")~=nil then
blalbl findFirstChild("Humanoid")~=nil then
BLBLBLB
Report Abuse
firesorccer1 is not online. firesorccer1
Joined: 27 Feb 2009
Total Posts: 1504
09 Dec 2009 10:49 AM
ok my fix worked ty all
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