I created a fist script/tool, But it only makes the hand rise but doesn't do the animations. The sounds and even the damage values work but the animations don't appear. Any help? (The Animations arent owned by me and you can't get them so is that the reason for the animations not showing?
Script (Fists) item type value(Melee)
Script 1- script.Parent.Damage.OnServerEvent:connect(function(play, humanoid, player, damage) print(humanoid) if humanoid then local creator_tag = Instance.new("ObjectValue") creator_tag.Value = player creator_tag.Name = "creator" script.Parent:FindFirstChild("Traits"):clone().Parent = creator_tag local damage_tag = Instance.new("IntValue") damage_tag.Name = "Damage" damage_tag.Value = damage damage_tag.Parent = creator_tag creator_tag.Parent = humanoid game.Debris:AddItem(creator_tag, 10) print("created") end end)
MouseIcon Script- wait(0.5) local play = game.Players.LocalPlayer local char = play.Character local hum = char.Humanoid local Tool = script.Parent
local mouse = play:GetMouse()
hit = Tool.Handle.Hit
local anim = nil
local jump = false
local tim = 0
local equipped = false
local damage = 6
local attack = ""
local throwing = true
local alternate = false
local idle = hum:LoadAnimation(script.Idle)
local p = true
local Effects = hum:WaitForChild("Effects")
-- what your walkspeed was before speed boost local oldws = nil
function weldTogether(x,y) local W = Instance.new("Weld") W.Part0 = x W.Part1 = y local CJ = CFrame.new(x.Position) local C0 = x.CFrame:inverse()*CJ local C1 = y.CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = x end
fist1 = Instance.new("Part") fist1.FormFactor = "Custom" fist1.Name = "Point" fist1.Size = Vector3.new(1,2,1) fist1.Transparency = 1 fist1.CanCollide = false fist1.CFrame = char["Right Arm"].CFrame + (char["Right Arm"].CFrame* CFrame.Angles(math.rad(-90),0,0)).lookVector fist2 = fist1:clone() fist2.CFrame = char["Left Arm"].CFrame + (char["Left Arm"].CFrame * CFrame.Angles(math.rad(-90),0,0)).lookVector foot1 = fist1:clone() foot1.CFrame = char["Right Leg"].CFrame + (char["Right Leg"].CFrame * CFrame.Angles(math.rad(-90),0,0)).lookVector weldTogether(fist1, char["Right Arm"]) weldTogether(fist2, char["Left Arm"]) weldTogether(foot1, char["Right Leg"]) fist1.Parent = Tool fist2.Parent = Tool foot1.Parent = Tool
fist1.Touched:connect(function(hit) touchy(fist1, "RightPunch", hit)
end) fist2.Touched:connect(function(hit) touchy(fist2, "LeftPunch", hit)
end) foot1.Touched:connect(function(hit) touchy(foot1, "AirKick", hit) end)
function swoosh() Tool.Handle.Swoosh.Pitch = math.random(10,14)/10 Tool.Handle.Swoosh:Play() end
local animTrack = nil
function animate()
if animTrack ~= nil then
animTrack:Stop()
end
attack = ""
if jump == true then -- in the air
if (game.Workspace.DistributedGameTime - tim) < 0.15 then -- uppercut
attack = "RightPunch" -- attacking part
swoosh()
animTrack = hum:LoadAnimation(script.Uppercut)
animTrack:Play()
wait(0.3)
else -- kick
attack = "AirKick"
swoosh()
animTrack = hum:LoadAnimation(script.AirKick)
animTrack:Play()
wait(0.3)
end
else -- not in the air
if alternate == false then -- right punch
alternate = true
attack = "RightPunch"
swoosh()
animTrack = hum:LoadAnimation(script.RightPunch)
animTrack:Play()
wait(0.2)
else -- left punch
alternate = false
attack = "LeftPunch"
swoosh()
animTrack = hum:LoadAnimation(script.LeftPunch)
animTrack:Play()
wait(0.2)
end
end
end
function attacker(humanoid) --determine animation hit.Pitch = math.random(10,14)/10
if humanoid:findFirstChild("Effects") and humanoid.Effects:findFirstChild("Dodge") then
else
hit:Play()
end
if humanoid:findFirstChild("DamageSystem") and not humanoid.Parent:findFirstChild("IsAShip") then -- do damage
script.Parent.Damage:FireServer(humanoid, play, damage)
elseif not humanoid.Parent:findFirstChild("IsAShip") then
humanoid:TakeDamage(damage)
end
end
en = true mouse.Button1Down:connect(function() -- click if Tool.Parent == char then if not en then return end en = false --throwing = true throwing = true animate() --[[ infront = root.Position + (root.CFrame.lookVector * 2) -- 2 studs infront of the player z = game.Players:GetChildren() for i= 1, #z do if z[i] ~= play and z[i].Character ~= nil and z[i].Character:findFirstChild("Torso") then enemy = z[i].Character if (root.Position - enemy.HumanoidRootPart.Position).magnitude < 3 then -- in range of an attack attacker(enemy.Humanoid) end end end ]] throwing = false wait(0.1)
en = true
-- speed boost --
local speed = Instance.new("IntValue",Effects)
speed.Name = "Speed"
speed.Value = 1
game.Debris:AddItem(speed,.35)
end
end)
function knockback(humanoid, point)
kp = Instance.new("Part") kp.Transparency = 1 kp.Name = "PuncKnockback" kp.FormFactor = "Custom" bv = Instance.new("BodyVelocity") bv.maxForce = Vector3.new(1e8,1e7,1e8) bv.velocity = point.Velocity + ((point.CFrame * CFrame.Angles(math.rad(-90),0,0)).lookVector * 4) print(point.Velocity) bv.Parent = kp kp.Size = Vector3.new(0,0,0) kp.CFrame = humanoid.Parent.Torso.CFrame weldTogether(kp, humanoid.Parent.Torso) kp.Parent = humanoid.Parent.Torso game.Debris:AddItem(kp, 0.1) end function touchy(point, part, hit) if not hit then return end if not throwing then return end if not p then return end if part ~= attack then return end p = false humanoid = nil if hit.Parent:findFirstChild("Humanoid") then humanoid = hit.Parent.Humanoid end if hit.Parent.Parent:findFirstChild("Humanoid") then humanoid = hit.Parent.Parent.Humanoid end if humanoid and not humanoid.Parent:findFirstChild("IsAShip") then if humanoid.Parent:findFirstChild("ForceField") then p = true return end attacker(humanoid) if humanoid.Parent:findFirstChild("Torso") then knockback(humanoid, point) end end
wait(0.2) p = true end
crzk = false function OnEquipped(mouse) -- select tool idle:Play() Tool.Handle.Crack:play() equipped = true end function UnEquipped(mouse) -- deselect tool idle:Stop() unequipped = false end hum.Jumping:connect(function() -- jumped jump = true tim = game.Workspace.DistributedGameTime end) hum.Running:connect(function() -- stopped jumping jump = false end) hum.Climbing:connect(function() -- stopped jumping jump = false end) Tool.Equipped:connect(OnEquipped) Tool.Unequipped:connect(UnEquipped)

2 comments
Can you please use code block for all your scripts? Because I can't really see here xd
Same