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 » Scripters
Home Search
 

Re: Penetrate Script

Previous Thread :: Next Thread 
someonedie is online. someonedie
Joined: 19 Mar 2011
Total Posts: 1710
14 Oct 2015 04:40 PM
I'm trying to make a Spear, but I'm having trouble making it Penetrate. How would I grab the info of the hitParent's object and add it to a table, and make the script not effect the Humanoid's it already penetrated? So like, if the spear hits that Noob, I want it to never be able to damage that Noob again, but can damage other Noobs, with the same name.
Report Abuse
someonedie is online. someonedie
Joined: 19 Mar 2011
Total Posts: 1710
14 Oct 2015 04:47 PM
Bump.

"Hello there Tommy Bun Bun! >:)"-Gigbity
Report Abuse
morashsPeasant is not online. morashsPeasant
Joined: 06 Jan 2011
Total Posts: 4944
14 Oct 2015 04:49 PM
if hitPerson.Name ~= "ThatNoob" then
--damage
end
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
14 Oct 2015 04:49 PM
[ Content Deleted ]
Report Abuse
someonedie is online. someonedie
Joined: 19 Mar 2011
Total Posts: 1710
14 Oct 2015 04:53 PM
Lol @Cody.

@Morash
No, I want the penetrating script to add a table to the object it hits, so it doesn't do more unnecessary damage.
Report Abuse
someonedie is online. someonedie
Joined: 19 Mar 2011
Total Posts: 1710
14 Oct 2015 06:08 PM
Bump.
Report Abuse
someonedie is online. someonedie
Joined: 19 Mar 2011
Total Posts: 1710
15 Oct 2015 01:50 PM
Bump.

"If life gives you lemons, JUST DO IT!!!!!!!!"
Report Abuse
Faisal1207 is not online. Faisal1207
Joined: 27 Dec 2013
Total Posts: 499
15 Oct 2015 01:55 PM
Scrupt... Guys, please forget, give the blind eye, pls


- "I say no because yes is overrated"
Report Abuse
someonedie is online. someonedie
Joined: 19 Mar 2011
Total Posts: 1710
15 Oct 2015 01:56 PM
Are you trying to attempt Shakesphere? Lol.
Report Abuse
ColorfulBrendon is not online. ColorfulBrendon
Joined: 28 Jul 2010
Total Posts: 23556
15 Oct 2015 01:59 PM
At first I mistook this for a satirical innuendo.
Report Abuse
Faisal1207 is not online. Faisal1207
Joined: 27 Dec 2013
Total Posts: 499
15 Oct 2015 01:59 PM
Huh?


- "I say no because yes is overrated"
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
15 Oct 2015 02:03 PM
store the hit humanoids in a table as an object

??????????
Report Abuse
someonedie is online. someonedie
Joined: 19 Mar 2011
Total Posts: 1710
15 Oct 2015 02:07 PM
Oh ok, thanks ozzy.
Report Abuse
EvilDonutNoob is not online. EvilDonutNoob
Joined: 26 Jan 2014
Total Posts: 440
15 Oct 2015 02:57 PM
First you need to warm up the spear by rubbing it, then you insert it gently into your desired target
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
15 Oct 2015 02:58 PM
yup


Red Blossoms
Report Abuse
someonedie is online. someonedie
Joined: 19 Mar 2011
Total Posts: 1710
15 Oct 2015 05:16 PM
Crap, how to insert object to table? o3o
Report Abuse
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
15 Oct 2015 05:18 PM
local objects = {}

objects[hit] = true


i make u math.sqrt()
Report Abuse
someonedie is online. someonedie
Joined: 19 Mar 2011
Total Posts: 1710
15 Oct 2015 05:24 PM
? I'm confused on how to use that. Can you take a look at the script?


r = game:service("RunService")
shaft = script.Parent

damage = shaft.Damage.Value
Push = shaft.Push.Value
Pierce = shaft.Pierce.Value

local Damaged = {}
local Damaging = false
function blow(hit)
if Pierce > 0 and Damaging == false and hit and hit.Parent and hit.Parent ~= unpack(Damaged) and hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Humanoid").Health > 0 and not (hit.Parent:FindFirstChild(FindFirstInstance(script.Parent, "Vector3Value").Name)) then
Damaging = true
local h=hit.Parent:FindFirstChild("Humanoid")
local t=hit.Parent:FindFirstChild("Torso")
local s=hit.Parent:FindFirstChild("Armor")
if s~= nil then
if s.Value > damage then
s.Value = s.Value - damage
if hit:FindFirstChild("Damaged") then
hit.Damaged:Play()
end
elseif s.Value <= damage then
s.Value = 0
end
Pierce = Pierce-Pierce
shaft:MakeJoints()
delay(60, function() shaft:Destroy() end)
elseif h~=nil and t~=nil and h.Health>0 then
for i,v in ipairs(h:GetChildren()) do
if v.Name=="creator" then
v:remove()
end
end
h:TakeDamage(damage)
local head=h.Parent:FindFirstChild("Head")
if head~=nil and head:FindFirstChild("Hurt") then
head.Hurt:Play()
end
Pierce = Pierce-1
if Pierce <= 0 then
shaft:Destroy()
end
table.insert(Damaged, hit.Parent)
print(Damaged)
Damaging = false
else
end
end
end

connection = shaft.Touched:connect(blow)
Report Abuse
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
15 Oct 2015 05:27 PM
whenever u detect that u hit a humanoid, insert the hit.Parent object into the table

local alreadyHit = {}

-- When you find a character

alreadyHit[hit.Parent] = true

-- Then, in an if statement when you're detecting hits

if alreadyHit[hit.Parent] ~= true then
-- code
end


i make u math.sqrt()
Report Abuse
wubby301 is not online. wubby301
Joined: 15 May 2010
Total Posts: 1907
15 Oct 2015 06:47 PM
table.insert(hit.Parent,Damaged) -- "Damaged" is the table.

Is that right?
Report Abuse
wubby301 is not online. wubby301
Joined: 15 May 2010
Total Posts: 1907
15 Oct 2015 06:48 PM
Use this instead

table.insert(Damaged, hit.Parent) -- "Damaged" is the table.
Report Abuse
wubby301 is not online. wubby301
Joined: 15 May 2010
Total Posts: 1907
15 Oct 2015 06:48 PM
Nvm.
Report Abuse
JDLENL is not online. JDLENL
Joined: 23 Dec 2009
Total Posts: 1109
15 Oct 2015 06:56 PM
ಠಟಠ
Report Abuse
LilMcManiac is online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
15 Oct 2015 07:03 PM
table.insert(Table, hit.Parent)

Simple.
Report Abuse
someonedie is online. someonedie
Joined: 19 Mar 2011
Total Posts: 1710
15 Oct 2015 07:17 PM
Isn't that what I put originally? ._.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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