Advertisement
TheUnknownDiscord

cub

Feb 10th, 2022 (edited)
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. e = Instance.new("RemoteEvent",owner.Character)
  2. e.Name = "The"
  3. t = 1
  4. local blacklist = {}
  5. coroutine.wrap(function()
  6. while wait() do
  7. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  8. v.Chatted:Connect(function(msg)
  9. if msg == "-blacklist" and not table.find(blacklist,v.Character) then
  10. table.insert(blacklist,v.Character)
  11. elseif msg == "-whitelist" and table.find(blacklist,v.Character) then
  12. table.remove(blacklist,table.find(blacklist,v.Character))
  13. end
  14. end)
  15. end
  16. end
  17. end)()
  18. e.OnServerEvent:Connect(function(_,hit)
  19. local g = Vector3.new(0, -game.Workspace.Gravity, 0);
  20. local x0 = owner.Character.HumanoidRootPart.CFrame * Vector3.new(0, 2, -2)
  21. local v0 = (hit - x0 - 0.5*g*t*t)/t;
  22.  
  23. local c = Instance.new("Part");
  24. c.CanCollide = true;
  25. c.Size = Vector3.new(15,15,15)
  26. c.CFrame = CFrame.new(x0)
  27. c.Velocity = v0
  28. c.Material = "Glass"
  29. c.Color = Color3.fromRGB(80,10,10)
  30. c.Transparency = 0.35
  31. local density = 1000000000000000000
  32. local friction = 1
  33. local elasticity = 0.5
  34. local frictionWeight = 10000
  35. local elasticityWeight = 10000
  36. local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
  37. c.CustomPhysicalProperties = physProperties
  38. c.Parent = script
  39. Instance.new("BodyGyro",c).MaxTorque = Vector3.new(500000000000,0,500000000000)
  40. local function findNearestTorso(pos)
  41. local list = game.Workspace:GetChildren()
  42. local torso = nil
  43. local dist = 1000000
  44. local temp = nil
  45. local human = nil
  46. local temp2 = nil
  47. for x = 1, #list do
  48. coroutine.wrap(function()
  49. temp2 = list[x]
  50. if (temp2.className == "Model") then
  51. temp = temp2:findFirstChild("Head")
  52. human = temp2:findFirstChild("Humanoid")
  53. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) and not table.find(blacklist,temp2) then
  54. if (temp.Position - pos).magnitude < dist then
  55. torso = temp
  56. dist = (temp.Position - pos).magnitude
  57. end
  58. end
  59. end
  60. end)()
  61. end
  62. return torso
  63. end
  64. waiting = false
  65. wait(0.5)
  66. c.Touched:Wait()
  67. coroutine.wrap(function()
  68. while true do
  69. task.wait()
  70. local torso = findNearestTorso(c.Position)
  71. if torso~=nil then
  72. local g = Vector3.new(0, -game.Workspace.Gravity, 0);
  73. local x0 = c.CFrame * Vector3.new(0, 0, 0)
  74. local v0 = (torso.Position - x0 - 0.5*g*t*t)/t
  75. c.Velocity = v0
  76. local TweenService = game:GetService("TweenService")
  77. local goal = {}
  78. goal.Size = Vector3.new(c.Size.X * 0.75,c.Size.Y * 1.5,c.Size.Z * 0.75)
  79. local tweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, true,0)
  80. local tween = TweenService:Create(c, tweenInfo, goal)
  81. tween:Play()
  82. wait(0.5)
  83. waiting = true
  84. c.Touched:Wait()
  85. local TweenService = game:GetService("TweenService")
  86. local goal = {}
  87. goal.Size = Vector3.new(c.Size.X * 0.75,c.Size.Y * 1.5,c.Size.Z * 0.75)
  88. local tweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, true,0)
  89. local tween = TweenService:Create(c, tweenInfo, goal)
  90. tween:Play()
  91. wait(5)
  92. end
  93. end
  94. end)()
  95. end)
  96. NLS([[
  97. e = owner.Character:WaitForChild("The")
  98. mouse = owner:GetMouse()
  99. owner:GetMouse().Button1Down:Connect(function()
  100. e:FireServer(mouse.Hit.p)
  101. end)
  102. ]],owner.PlayerGui)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement