of     1   

EverlastingDragon
#137703395Saturday, June 21, 2014 10:47 PM GMT

I edited a Linked Sword so that it would deal no damage to anything that had the value "IsShield" in it. But the problem is that the sword hits through the shield and still damages the player, is there a certain way where I can make this work?
batistapowerbonbtla
#137704148Saturday, June 21, 2014 10:55 PM GMT

Change the IsShield's parent to the player's character and check for it there
EverlastingDragon
#137710505Sunday, June 22, 2014 12:04 AM GMT

That would work, but I want it so if the sword hits the shield, it negates the damage to the player.
EverlastingDragon
#137795381Sunday, June 22, 2014 2:54 PM GMT

I've also tried to add a debounce to the hit function, but it destroys the functionality of a sword.
konichiwah91
#137795904Sunday, June 22, 2014 3:01 PM GMT

A debounce simply prevents a script from repeating itself due to client/server-side lag.
konichiwah91
#137796315Sunday, June 22, 2014 3:07 PM GMT

Oh, If you were simply creating a value for defense, why don't you just divide a global variable for the defense value in the player to all weapons?
RoflBread
#137796636Sunday, June 22, 2014 3:12 PM GMT

Grab the players name/instance from the shield via the .Touched event of the sword, and then add it to a table. Then, for the remainder of the sword swing, check if the subsequent .Touched events hit any player in the table, and if any do, deal reduced damage. Reset the table when the sword is activated again. Though it would probably be better just to stop the swing if the sword hits a shield, as if it's bouncing off.
EverlastingDragon
#137826688Sunday, June 22, 2014 8:22 PM GMT

This is what I've got so far, but it's still not working, and nothing appears in the Output. function blow(hit) if (hit.Parent == nil) then return end -- happens when bullet hits sword local humanoid = hit.Parent:findFirstChild("Humanoid") local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character if humanoid~=nil and humanoid ~= hum and hum ~= nil then -- final check, make sure sword is in-hand local right_arm = vCharacter:FindFirstChild("Right Arm") if (right_arm ~= nil) then local joint = right_arm:FindFirstChild("RightGrip") if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then if hit:FindFirstChild("IsShield") ~= nil then print("HitShield") local t = {} table.insert(t, humanoid.Parent.Name) print(table.concat (t, ' ')) for i = 1,#t do if (string.upper(humanoid.Parent.Name) == string.upper(t[i])) then return true end humanoid:TakeDamage(0) table.remove(t) wait(1) untagHumanoid(humanoid) end elseif hit:FindFirstChild("IsShield") == nil then print("NoShield") humanoid:TakeDamage(damage) table.remove(t) wait(1) untagHumanoid(humanoid) end end end end end
batistapowerbonbtla
#137829963Sunday, June 22, 2014 8:51 PM GMT

Try asking in Scripters
EverlastingDragon
#137840538Sunday, June 22, 2014 10:31 PM GMT

But this is the thread to ask for scripting help .-.
EverlastingDragon
#138135541Wednesday, June 25, 2014 4:17 PM GMT

Bump
EverlastingDragon
#138212826Thursday, June 26, 2014 3:27 AM GMT

Bump
EverlastingDragon
#138758051Monday, June 30, 2014 5:58 PM GMT

Bump
EverlastingDragon
#138811782Tuesday, July 01, 2014 2:02 AM GMT

Bump
batistapowerbonbtla
#138820174Tuesday, July 01, 2014 3:18 AM GMT

Try asking in Scripters

    of     1