|
| 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 |
|
|
|
| 14 Oct 2015 04:47 PM |
Bump.
"Hello there Tommy Bun Bun! >:)"-Gigbity |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2015 04:49 PM |
if hitPerson.Name ~= "ThatNoob" then --damage end |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
| |
|
|
| 15 Oct 2015 01:50 PM |
Bump.
"If life gives you lemons, JUST DO IT!!!!!!!!" |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2015 01:55 PM |
Scrupt... Guys, please forget, give the blind eye, pls
- "I say no because yes is overrated" |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2015 01:56 PM |
| Are you trying to attempt Shakesphere? Lol. |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2015 01:59 PM |
| At first I mistook this for a satirical innuendo. |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2015 01:59 PM |
Huh?
- "I say no because yes is overrated" |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
|
| 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
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
| |
|
|
| 15 Oct 2015 05:16 PM |
| Crap, how to insert object to table? o3o |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2015 05:18 PM |
local objects = {}
objects[hit] = true
i make u math.sqrt() |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 15 May 2010 |
| Total Posts: 1907 |
|
| |
|
JDLENL
|
  |
| Joined: 23 Dec 2009 |
| Total Posts: 1109 |
|
| |
|
|
| 15 Oct 2015 07:03 PM |
table.insert(Table, hit.Parent)
Simple. |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2015 07:17 PM |
| Isn't that what I put originally? ._. |
|
|
| Report Abuse |
|
|