|
| 31 Dec 2011 02:38 PM |
i want to make it so that when a hints text is "Morning has come!!!" then all of the zombies on the map dies. I have tried doing this
m = game.Workspace.Message
if m.Text == "Morning has come!!!" then script.Parent.Humanoid.Health = 0 then script.Parent.Humanoid.MaxHealth = 0 end
but that doesnt work. can sombody help me? |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2011 02:38 PM |
sorry i mean the script is like this
m = game.Workspace.Message
if m.Text == "Morning has come!!!" then script.Parent.Humanoid.Health = 0 script.Parent.Humanoid.MaxHealth = 0 end
|
|
|
| Report Abuse |
|
|
|
| 31 Dec 2011 02:43 PM |
| First off, a hint and a message are two different things. Second, why aren't you using a script to make the text say Morning has come and then do that stuff instead of the if then statement? Third, Idk where the script goes, but unless it's inside a player that won't kill the person. Fourth, you don't have to change the MaxHealth to zero. |
|
|
| Report Abuse |
|
|
789cab
|
  |
| Joined: 13 Jul 2009 |
| Total Posts: 3145 |
|
|
| 31 Dec 2011 02:45 PM |
local m = Instance.new("Message", Workspace) if m.Text == "Morning has come!!!" then script.Parent.Humanoid.Health = 0 script.Parent.Humanoid.MaxHealth = 0 wait() -- put how long you want to wait here. m:Remove() end |
|
|
| Report Abuse |
|
|
Xsitsu
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 2921 |
|
|
| 31 Dec 2011 02:45 PM |
m = game.Workspace.Message while true do wait(1) if m.Text == "Morning has come!!!" then script.Parent:BreakJoints() end end
Put that script inside of the zombie, it will check every second if it's time to kill it and if it is then it will die. |
|
|
| Report Abuse |
|
|
789cab
|
  |
| Joined: 13 Jul 2009 |
| Total Posts: 3145 |
|
|
| 31 Dec 2011 02:45 PM |
My bad,
local m = Instance.new("Message", Workspace) if m.Text == "Morning has come!!!" then script.Parent.Humanoid.Health = 0 script.Parent.Humanoid.MaxHealth = 0 wait() -- put how long you want to wait here. m:Remove() end end -- forgot 2 ends |
|
|
| Report Abuse |
|
|
789cab
|
  |
| Joined: 13 Jul 2009 |
| Total Posts: 3145 |
|
|
| 31 Dec 2011 02:48 PM |
xitsu, that won't work. You can't put while true do wait() and it needs to insert the message local m = Instance.new("Message", Workspace)
|
|
|
| Report Abuse |
|
|
789cab
|
  |
| Joined: 13 Jul 2009 |
| Total Posts: 3145 |
|
|
| 31 Dec 2011 02:49 PM |
local m = Instance.new("Message", Workspace) im.Text == "Morning has come!!!" if Lighting.TimeOfDay = 12:00:00 then script.Parent.Humanoid.Health = 0 script.Parent.Humanoid.MaxHealth = 0 wait() m:Remove() end end |
|
|
| Report Abuse |
|
|
Jaccob
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 986 |
|
|
| 31 Dec 2011 02:49 PM |
@789cab
He already has a message in his Workspace it seems, so why create another?
m = Workspace.Message
if m ~= nil then -- Because if the message is removed, then script breaks. if m.Text == "Morning has come!!!" then script.Parent:Remove() wait(5) m:Remove() end end |
|
|
| Report Abuse |
|
|
Jaccob
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 986 |
|
|
| 31 Dec 2011 02:50 PM |
script.Parent:BreakJoints()
Sorry. |
|
|
| Report Abuse |
|
|
789cab
|
  |
| Joined: 13 Jul 2009 |
| Total Posts: 3145 |
|
|
| 31 Dec 2011 02:50 PM |
I keep erroring,
local m = Instance.new("Message", Workspace) if Lighting.TimeOfDay = 12:00:00 then m.Text == "Morning has come!!!" script.Parent.Humanoid.Health = 0 script.Parent.Humanoid.MaxHealth = 0 wait() m:Remove() end end |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2011 02:50 PM |
| But the Hint has already been made |
|
|
| Report Abuse |
|
|
789cab
|
  |
| Joined: 13 Jul 2009 |
| Total Posts: 3145 |
|
|
| 31 Dec 2011 02:51 PM |
| jacob, you still removed the message? |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2011 02:52 PM |
| thanks jacob i will try that. The hints name is message and is already in the workspace. |
|
|
| Report Abuse |
|
|
789cab
|
  |
| Joined: 13 Jul 2009 |
| Total Posts: 3145 |
|
|
| 31 Dec 2011 02:57 PM |
| If its a hint its at the top of the screenmessages are in the middle |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2011 03:02 PM |
| ikt. it is a hint but the name of the hint is Message |
|
|
| Report Abuse |
|
|
789cab
|
  |
| Joined: 13 Jul 2009 |
| Total Posts: 3145 |
|
| |
|
| |
|