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: Script that only kills what is told to kill.

Previous Thread :: Next Thread 
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
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
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
21 Nov 2012 10:55 PM
I would need this to be able to go into a gun.
Report Abuse
AComplexName is not online. AComplexName
Joined: 11 Nov 2012
Total Posts: 132
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
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
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
AComplexName is not online. AComplexName
Joined: 11 Nov 2012
Total Posts: 132
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
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
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
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
21 Nov 2012 11:29 PM
Can anyone please help?
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
21 Nov 2012 11:35 PM
Bump.
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
22 Nov 2012 08:09 AM
Anyone?
Report Abuse
Monkey727 is not online. 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
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
22 Nov 2012 08:29 AM
Can anyone please help? I can't figure it out,
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
22 Nov 2012 08:30 AM
Does that go into a separate script?
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
22 Nov 2012 08:32 AM
Just learn to script kid.
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
22 Nov 2012 08:32 AM
That's what I'm trying to do, "kid."
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
22 Nov 2012 08:34 AM
No you're not kid.
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
22 Nov 2012 08:35 AM
Why do you think I'm here? Kid. I'm not going to argue.
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
22 Nov 2012 08:36 AM
To tell us to make you a script. Kid, learn to script.
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
22 Nov 2012 08:37 AM
You don't seem to have what it takes to script.
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
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
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
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
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
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
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
22 Nov 2012 08:42 AM
Keep dreaming kid.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
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
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Nov 2012 08:57 AM
Read 'em
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
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
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