Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tool = script.Parent
- local canGive
- local function onTouch(otherPart)
- local humanoid = otherPart.Parent:FindFirstChild("Humanoid")
- if humanoid then
- if humanoid.Parent ~= tool.Parent and canGive then
- canGive = false
- tool.Parent = humanoid.Parent
- end
- end
- end
- local function slash()
- local str = Instance.new("StringValue")
- str.Name = "toolanim"
- str.Value = "Slash"
- str.Parent = tool
- canGive = true
- wait(.5)
- canGive = false
- end
- tool.Handle.Touched:Connect(onTouch)
- tool.Activated:Connect(slash)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement