Motioning
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 254 |
|
|
| 07 May 2015 03:45 PM |
So i'm using this sword from roblox battle, and i'm trying to make it only attack a dummy a made. This is so you can't kill other players in the lobby. The dummy's name is Dummy. I don't get a error, it just doesn't do anything to the dummy. Help?
These are only parts of the script, not the full thing.
handle.Touched:connect(function(hit) if equipped and character and humanoid and humanoid.Health > 0 and humanoid.Name == "Dummy" and not hit:isDescendantOf(character) then local targethumanoid = hit.Parent:FindFirstChild("Humanoid") if targethumanoid and targethumanoid.Health > 0 and not hithumanoids[targethumanoid] then hithumanoids[targethumanoid] = true
for _, v in pairs(targethumanoid:GetChildren()) do if v and v.Name == "creator" then v:remove() end end local tag = Instance.new("ObjectValue") tag.Name = "creator" tag.Value = player debris:AddItem(tag, 3) tag.Parent = targethumanoid
local damagemultiplier = 1
targethumanoid:TakeDamage(damage * (combo + 1) * damagemultiplier) end end end)
tool.Equipped:connect(function() equipped = true lastclick = tick() combo = 0 character = tool.Parent player = game.Players:GetPlayerFromCharacter(character) humanoid = character:FindFirstChild("Humanoid") if humanoid then humanoid.WalkSpeed = 16 * speedboost else character = nil end end)
gr8 b8 m8 r8=8/8 |
|
|
| Report Abuse |
|
|
Motioning
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 254 |
|
| |
|
Motioning
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 254 |
|
| |
|
Motioning
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 254 |
|
| |
|
|
| 07 May 2015 04:46 PM |
the TakeDamage() function doesn't work for Dummys, only for the Players.
Just subtract the health by the damage dealth.
targethumanoid.Health = targetHumanoid.Health - (damage * (combo + 1) * damagemultiplier) |
|
|
| Report Abuse |
|
|