|
| 25 Apr 2014 09:02 PM |
How can I make it so that it keeps checking if the zombie is deleted. If the zombie is deleted, it will say the messages in the script:
if not workspace:FindFirstChild("Zombie") then msg = Instance.new("Message", Workspace) msg.Text = "Josh the mic: Nice job killing the zombie." wait(3) msg:Destroy() end |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 25 Apr 2014 09:07 PM |
check=function() if(Workspace['Zombie'])~=nil)then msg=Instance.new('Message',workspace); msg.Text='Josh on mic: Nice job killing the zombie.'; wait'3'msg:destroy''end end; check(Workspace); |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2014 09:08 PM |
| How can I make it loop? Like right after he dies the loop will end and the message will appear? |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 25 Apr 2014 09:08 PM |
Oops. forgot to add another parenthesis lol
check=function() if((Workspace['Zombie'])~=nil)then msg=Instance.new('Message',workspace); msg.Text='Josh on mic: Nice job killing the zombie.'; wait'3'msg:destroy''end end; check(Workspace); |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2014 09:11 PM |
| Still didn't answer my question. |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 25 Apr 2014 09:11 PM |
You use the .Died event to 'check' if it is dead
check=function() Workspace['Zombie'].Humanoid.Died:connect(function(a) if(a.Parent.Health==0)then msg=Instance.new('Message',workspace); msg.Text='Josh on mic: Nice job killing the zombie' wait'3'msg:destroy''end end)end; check(Workspace.Zombie); |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2014 09:14 PM |
| The zombie gets deleted right when he dies. |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 25 Apr 2014 09:15 PM |
| isn't that what you want? unless ou want your map cluttered with dead humanoids lol |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2014 09:16 PM |
| Ugh, let me repeat this again: How can I make it so it does a loop check to see if the zombie doesn't exist. If it doesn't exist, it will do the rest. |
|
|
| Report Abuse |
|
|
NeonRiver
|
  |
| Joined: 12 Feb 2013 |
| Total Posts: 4936 |
|
| |
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 25 Apr 2014 09:39 PM |
...
check=function() if(Workspace.Zombie~=nil)then pcall(function() while wait'1'do Workspace['Zombie'].Humanoid.Died:connect(function(a) if(a.Parent.Health==0)then msg=Instance.new('Message',workspace); msg.Text='Josh on mic: Nice job killing the zombie' wait'3'msg:destroy'' end end)end end)end end; check(Workspace.Zombie);
does that solve ur problem sir |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Apr 2014 12:47 AM |
| Doesn't work because you make it too complicated |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 26 Apr 2014 12:58 AM |
how is it too complicated this is basic stuff Do you know Lua or not? |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 01:03 AM |
while wait() do if Workspace["Zombie"]["Zombie"].Health < 1 then -- Change the second Zombie to the name of the Zombie's humanoid. local msg = Instance.new("Message", Workspace) msg.Text = "Josh the mic: Nice job killing the zombie." wait(3) msg:Destroy() break end end |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 01:08 AM |
This also works :
zombie = Workspace["Zombie"] -- Change "Zombie" to the name of the Zombie. humanoid = zombie:FindFirstChild("Zombie") -- Change "Zombie" to the Zombie's Humanoid name.
while wait() do if humanoid and humanoid.Health < 1 then local msg = Instance.new("Message", Workspace) msg.Text = "Josh the mic: Nice job killing the zombie." wait(3) msg:Destroy() break else wait(5) print "Error[Zombie not dead, or not found.]" end end |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 01:12 AM |
| Well the point is TransIate, it doesn't work |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
| |
|
|
| 26 Apr 2014 01:23 AM |
| You need to see the whole script though. Get on skype dude. |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
| |
|
|
| 26 Apr 2014 04:44 AM |
Workspace.Zombie.Humanoid.Died:connect(function() --Do you stuff end)
Change Zombie to his name
If he has a "Zombie" inside him change the Humanoid to Zombie.
If he has a "Monster" change Humanoid to Monster
(Do this only if it has a little robloxian, not a script)
Transiate, take it easy on him, he obviously don't know a Lua |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 05:50 AM |
@TransLate It's Venom (LordAbolition)
@war I do know Lua. Is this forum meant to only people that don't know Lua? I'm working on a zombie survival game based off of Contamination with absolutely no free models. All from scratch. Even the zombie I scripted. So don't judge people until you know them well. |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 26 Apr 2014 05:59 AM |
| How can you say you 'know' Lua if you can't even create a loop? |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 06:03 AM |
| I know how to create a loop. I'm just wondering how to make the loop end. Or does it end automatically? |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|