|
| 21 Nov 2012 10:54 PM |
| I don't know how to script a script that I need to put in a gun so it only kills what is told to. So if you shoot it at what you tell the script to kill if you shoot it, then you kill it. I need it to specifically not kill players in the game. I need it to be able to kill zombies and noobs and such. Before you call me a noob, I don't know where to start on this script. Thanks. |
|
|
| Report Abuse |
|
|
|
| 21 Nov 2012 10:55 PM |
| I would need this to be able to go into a gun. |
|
|
| Report Abuse |
|
|
|
| 21 Nov 2012 11:07 PM |
You need to find where the part in the script talks about a funtion onTouch. That is where you need to put something like
if (hit.Whatever == Whatever) then damage = 50 else damage = 0 end
|
|
|
| Report Abuse |
|
|
|
| 21 Nov 2012 11:10 PM |
| What would I put in the Whatever == Whatever if a zombie that is a disaster got shot by the gun? And how would I do this for several different things? |
|
|
| Report Abuse |
|
|
|
| 21 Nov 2012 11:19 PM |
If the zombies all have to same name then you would put
if (hit.Parent.Name = Zombie'sName) then ...
or the way i like it. But takes some extra time. Make a script to where whenever someone spawns or a zombie spawns, you give then a numvalue. Then when the bullet hits the target it is something like this
if (hit.Parent.NumValue.Value == 1 then) -- 1 would mean to kill. ANother script --would change the NumberValue
|
|
|
| Report Abuse |
|
|
|
| 21 Nov 2012 11:21 PM |
| I don't know how to do that. And this isn't for just Zombies. This is for several different disasters, like Zombies, Noobs, Trolls, etc. so how would I make a script for all them? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
Monkey727
|
  |
| Joined: 12 Jan 2009 |
| Total Posts: 969 |
|
|
| 22 Nov 2012 08:24 AM |
ThingsToKill = {"Zombie","Noob","Troll"} Damage = 5
script.Parent.Touched:connect(function(hit) KillThing = false for i=1,#ThingsToKill do if hit.Parent.Name == ThingsToKill[i] then KillThing = true end end
if KillThing == true then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - Damage -- Or whatever end script.Parent:Remove() -- Remove bullet to stop multiple damage end)
This script would need to be cloned into the bullets from the gun. |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 08:29 AM |
| Can anyone please help? I can't figure it out, |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 08:30 AM |
| Does that go into a separate script? |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Nov 2012 08:32 AM |
| That's what I'm trying to do, "kid." |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Nov 2012 08:35 AM |
| Why do you think I'm here? Kid. I'm not going to argue. |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 08:36 AM |
| To tell us to make you a script. Kid, learn to script. |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 08:37 AM |
| You don't seem to have what it takes to script. |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 08:38 AM |
| I do, and I know how to script. I just don't know how to do this. |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 08:39 AM |
You don't know how to script. You admitted it before.
To do this you would need something to clarify a monster or a table with the names of the monsters. You weren't able to notice this. You don't have what it takes to script. |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 08:40 AM |
| "You don't have what it takes to script." I do. End of discussion. Argue with yourself all you want. |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Nov 2012 08:54 AM |
here is how you learn to script.. READ THE FOLLOWING:
http://wiki.roblox.com/index.php/Lua_Help Introduction series - read these first!
http://wiki.roblox.com/index.php/Absolute_beginner%27s_guide_to_scripting
http://www.lua.org/pil/ |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Nov 2012 09:14 AM |
I pmed the guy that I replied to this thread and he says
"hahah no i ant falling for your trick"
.....
|
|
|
| Report Abuse |
|
|