Advertisement
DrawingJhon

Kid Punishment

May 18th, 2024
733
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. local owner: Player = getfenv().owner
  2. local NLS: () -> () = getfenv().NLS
  3.  
  4. local remote = Instance.new("RemoteEvent")
  5. remote.Name = "HitDummy"
  6. remote.OnServerEvent:Connect(function(player, dummy)
  7.     if player ~= owner then return end
  8.    
  9.     local head = dummy.Head
  10.    
  11.     local weld = Instance.new("Weld")
  12.     weld.Part0 = owner.Character["Right Arm"]
  13.     weld.Part1 = head
  14.     weld.C0 = CFrame.new(0, -1, 0)
  15.     weld.C1 = CFrame.new(0, 0.5, 0)
  16.     weld.Parent = head
  17.    
  18.     for _, part in dummy:GetDescendants() do
  19.         if part:IsA("BasePart") then
  20.             part:SetNetworkOwner(player)
  21.         end
  22.     end
  23. end)
  24.  
  25. remote.Parent = NLS([==[
  26. local mouse = owner:GetMouse()
  27. local remote = script:WaitForChild("HitDummy")
  28.  
  29. mouse.Button1Down:Connect(function()
  30.     if mouse.Target.Parent:FindFirstChildOfClass("Humanoid") then
  31.         remote:FireServer(mouse.Target.Parent)
  32.        
  33.     end
  34. end)
  35.  
  36. ]==], owner.Character)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement