Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.ReplicatedStorage.VIP_Test:InvokeServer()
- --------------------- TEMPLATE BLADE WEAPON ---------------------------
- -- Waits for the child of the specified parent
- local function WaitForChild(parent, childName)
- while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
- return parent[childName]
- end
- function OnEquipped(mouse)
- PlayStabPunch = WaitForChild(Tool, 'PlayStabPunch')
- PlayDownStab = WaitForChild(Tool, 'PlayDownStab')
- PlayThrow = WaitForChild(Tool, 'PlayThrow')
- PlayThrowCharge = WaitForChild(Tool, 'PlayThrowCharge')
- BlowConnection = Handle.Touched:connect(Blow)
- MyCharacter = Tool.Parent
- MyTorso = MyCharacter:FindFirstChild('Torso')
- MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
- MyPlayer = PlayersService.LocalPlayer
- if mouse then
- Button1DownConnection = mouse.Button1Down:connect(OnLeftButtonDown)
- Button1UpConnection = mouse.Button1Up:connect(OnLeftButtonUp)
- Button2DownConnection = mouse.Button2Down:connect(OnRightButtonDown)
- --Button2UpConnection = mouse.Button2Up:connect(OnRightButtonUp)
- end
- KnifeUp()
- end
- function OnUnequipped()
- Handle.UnEquip:Play()
- -- Unequip logic here
- if BlowConnection then
- BlowConnection:disconnect()
- BlowConnection = nil
- end
- if Button1DownConnection then
- Button1DownConnection:disconnect()
- Button1DownConnection = nil
- end
- if Button1UpConnection then
- Button1UpConnection:disconnect()
- Button1UpConnection = nil
- end
- if Button2UpConnection then
- Button2UpConnection:disconnect()
- Button2UpConnection = nil
- end
- if Button2DownConnection then
- Button2DownConnection:disconnect()
- Button2DownConnection = nil
- end
- MyHumanoid = nil
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Unequipped:connect(OnUnequipped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement