SebTDZ

Strike Command

Mar 29th, 2019
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.68 KB | None | 0 0
  1. game.Players.SebTDZ500.Chatted:connect(function(message)
  2.     local messageLow = string.lower(message)
  3.     if  messageLow:sub(1, 7) == "!block " then
  4.         local TargetPlayer = FindPlayer(message:sub(8))
  5.         Hit(game.Players.SebTDZ500.Name, TargetPlayer)
  6.     end
  7. end)
  8.  
  9. function FindPlayer(FindUser)
  10.     local findUser = string.lower(FindUser)
  11.     local inputsize = string.len(findUser)
  12.     for i, v in pairs(game.Players:GetChildren()) do
  13.         local NameLow = string.lower(v.Name)
  14.         if NameLow:sub(1, inputsize) == findUser:sub(1, inputsize) then
  15.             return v.Name
  16.         end
  17.     end
  18. end
  19.  
  20. function Hit(username1, username2)
  21. --Player1
  22. plr1 = game.Workspace:WaitForChild(username1)
  23. plr1H = plr1:WaitForChild('HumanoidRootPart')
  24. --Player2
  25. plr2 = game.Workspace:WaitForChild(username2)
  26. plr2H = plr2:WaitForChild('HumanoidRootPart')
  27. --New Part
  28. local NewPart = Instance.new("Part")
  29. NewPart.Parent = game.Workspace
  30. NewPart.Position = plr1H.Position + Vector3.new(0, 25, 0)
  31. NewPart.Material = Enum.Material.Neon
  32. NewPart.Color = Color3.new(0, 244, 150)
  33. NewPart.TopSurface = "Smooth"
  34. NewPart.BottomSurface = "Smooth"
  35. NewPart.Anchored = false
  36. NewPart.Size = Vector3.new(35, 35, 35)
  37. --BodyPos
  38. local Part = NewPart
  39. local Body = Instance.new("BodyPosition")
  40. Body.Parent = Part
  41. Body.Position = plr1H.Position + Vector3.new(0, 25, 0)
  42. Body. MaxForce = Vector3.new(250000000000000000000000, 250000000000000000000000, 250000000000000000000000)
  43. Part.Anchored = false
  44. wait(1.5)
  45. --Strike
  46. Body.Position = Body.Position + Vector3.new(0, 250, 0)
  47. wait(1)
  48. NewPart.RotVelocity = Vector3.new(math.random(100), math.random(100), math.random(100))
  49. wait(4)
  50. Body.P = 100000
  51. Body.Position = plr2H.Position
  52. wait(10)
  53. NewPart:Destroy()
  54. end
Advertisement
Add Comment
Please, Sign In to add comment