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
 

Why doesn't this work?

Previous Thread :: Next Thread 
SMELLYJOJOJOJOJOJOJO is not online. SMELLYJOJOJOJOJOJOJO
Joined: 05 Mar 2011
Total Posts: 1322
29 Jan 2017 07:46 AM
I'm making a blocking system with my sword and I have the sword block animation down, it's just refusing to protect the player who's blocking

This is part of the code in ServerScript, I have no errors:

local BlockBoolen = Character:FindFirstChild("Block") or Instance.new("BoolValue"); BlockBoolen.Name = "Block"; BlockBoolen.Parent = Character
local BlockPercentage = 100 -- this will block 50% of damage intake when blocking

Tool.Activated:connect(function()
local ClickDelta = tick() - LastClick
if ClickDelta > SwingTime and (not BlockBoolen.Value) then
LastClick = tick()
HitHumanoids = {}
if ClickDelta < SwingTime + ComboWindow then
Combo = (Combo + 1) % 3
else
Combo = 0
end
if Player then
local DamageFunction = Blade.Touched:connect(function(hit)
if Equipped and Character and Humanoid and Humanoid.Health > 0 and tick() > LastClick and not hit:isDescendantOf(Character) then
-- See if TK?
local TargetHumanoid = hit.Parent:FindFirstChild("Humanoid")
if TargetHumanoid and TargetHumanoid.Health > 0 and not HitHumanoids[TargetHumanoid]then
HitHumanoids[TargetHumanoid] = true
local BlockBoolenOther = TargetHumanoid.Parent:FindFirstChild("Block")

if BlockBoolenOther then
if BlockBoolenOther.Value == true then
TargetHumanoid:TakeDamage((Damage * (Combo + 1)) * (BlockPercentage * 0.01))
else
TargetHumanoid:TakeDamage(Damage * (Combo + 1))
end
else
TargetHumanoid:TakeDamage(Damage * (Combo + 1))
end
end
end
end)
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