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: detect and kill

Previous Thread :: Next Thread 
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
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
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
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
Z3R0xT0L3R4NC3 is not online. Z3R0xT0L3R4NC3
Joined: 06 Feb 2011
Total Posts: 127
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 is not online. 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 is online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Jaccob
Joined: 19 Oct 2008
Total Posts: 986
31 Dec 2011 02:50 PM
script.Parent:BreakJoints()

Sorry.
Report Abuse
789cab is not online. 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
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
31 Dec 2011 02:50 PM
But the Hint has already been made
Report Abuse
789cab is not online. 789cab
Joined: 13 Jul 2009
Total Posts: 3145
31 Dec 2011 02:51 PM
jacob, you still removed the message?
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
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 is not online. 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
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
31 Dec 2011 03:02 PM
ikt. it is a hint but the name of the hint is Message
Report Abuse
789cab is not online. 789cab
Joined: 13 Jul 2009
Total Posts: 3145
31 Dec 2011 03:08 PM
Did his work?
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
31 Dec 2011 03:42 PM
nope
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