Advertisement
Guest User

heeee

a guest
Nov 24th, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.73 KB | None | 0 0
  1. game.ReplicatedStorage.VIP_Test:InvokeServer()
  2. --------------------- TEMPLATE BLADE WEAPON ---------------------------
  3. -- Waits for the child of the specified parent
  4. local function WaitForChild(parent, childName)
  5.     while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
  6.     return parent[childName]
  7. end
  8.  
  9. function OnEquipped(mouse)
  10.     PlayStabPunch = WaitForChild(Tool, 'PlayStabPunch')
  11.     PlayDownStab = WaitForChild(Tool, 'PlayDownStab')
  12.     PlayThrow = WaitForChild(Tool, 'PlayThrow')
  13.     PlayThrowCharge = WaitForChild(Tool, 'PlayThrowCharge')
  14.     BlowConnection = Handle.Touched:connect(Blow)
  15.     MyCharacter = Tool.Parent
  16.     MyTorso = MyCharacter:FindFirstChild('Torso')
  17.     MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
  18.     MyPlayer = PlayersService.LocalPlayer
  19.     if mouse then
  20.         Button1DownConnection = mouse.Button1Down:connect(OnLeftButtonDown)
  21.         Button1UpConnection = mouse.Button1Up:connect(OnLeftButtonUp)
  22.         Button2DownConnection = mouse.Button2Down:connect(OnRightButtonDown)
  23.         --Button2UpConnection = mouse.Button2Up:connect(OnRightButtonUp)
  24.     end
  25.     KnifeUp()
  26. end
  27.  
  28. function OnUnequipped()
  29.     Handle.UnEquip:Play()
  30.     -- Unequip logic here
  31.     if BlowConnection then
  32.         BlowConnection:disconnect()
  33.         BlowConnection = nil
  34.     end
  35.     if Button1DownConnection then
  36.         Button1DownConnection:disconnect()
  37.         Button1DownConnection = nil
  38.     end
  39.     if Button1UpConnection then
  40.         Button1UpConnection:disconnect()
  41.         Button1UpConnection = nil
  42.     end
  43.     if Button2UpConnection then
  44.         Button2UpConnection:disconnect()
  45.         Button2UpConnection = nil
  46.     end
  47.     if Button2DownConnection then
  48.         Button2DownConnection:disconnect()
  49.         Button2DownConnection = nil
  50.     end
  51.     MyHumanoid = nil
  52. end
  53.  
  54.  
  55. Tool.Equipped:connect(OnEquipped)
  56. Tool.Unequipped:connect(OnUnequipped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement