Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tool = script.Parent
- local idle = script:WaitForChild("Idle")
- local idleTrack
- local throw = script:WaitForChild("Throw")
- local throwTrack
- local throwSound = script:WaitForChild("ThrowSound")
- local hitSound = script:WaitForChild("HitSound")
- local debounce = false
- local charsHit = {}
- local shuriken = game.ServerStorage.Shuriken
- tool.Equipped:Connect(function()
- if not idleTrack then idleTrack = tool.Parent.Humanoid:LoadAnimation(idle) end
- if not idleTrack.IsPlaying then idleTrack:Play() end
- end)
- tool.Unequipped:Connect(function()
- if idleTrack and idleTrack.IsPlaying then idleTrack:Stop() end
- end)
- tool.Activated:Connect(function()
- if debounce then return end
- debounce = true
- if not throwTrack then throwTrack = tool.Parent.Humanoid:LoadAnimation(throw) end
- if not throwTrack.IsPlaying then throwTrack:Play() end
- if throwTrack.IsPlaying then throwTrack.Stopped:Wait() end
- throwSound:Play()
- tool.Handle.Transparency = 1
- local shurikenClone = shuriken:Clone()
- shurikenClone.CFrame = tool.Handle.CFrame
- shurikenClone.Parent = workspace
- local bf = Instance.new("BodyForce")
- bf.Force = shurikenClone.CFrame.LookVector * 200 + Vector3.new(0, 120, 0)
- bf.Parent = shurikenClone
- local bav = Instance.new("BodyAngularVelocity")
- bav.AngularVelocity = Vector3.new(0, -400, 0)
- bav.Parent = shurikenClone
- game:GetService("Debris"):AddItem(shurikenClone, 20)
- shurikenClone.Touched:Connect(function(touch)
- if touch.Parent:FindFirstChild("Humanoid") and touch.Parent ~= script.Parent.Parent and not charsHit[touch.Parent] then
- charsHit[touch.Parent] = true
- touch.Parent.Humanoid:TakeDamage(10)
- hitSound:Play()
- wait(0.4)
- charsHit[touch.Parent] = nil
- end
- end)
- wait(0.4)
- debounce = false
- tool.Handle.Transparency = 0
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement