Advertisement
HenloMyDude

r15 engineer script by me

Jul 5th, 2020
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.29 KB | None | 0 0
  1.  
  2. plr = owner
  3. char = plr.Character
  4. root = char.HumanoidRootPart
  5. hed = char.Head
  6. neck = hed.Neck
  7. necknor = neck.C0
  8. rootj = char.UpperTorso:FindFirstChildOfClass("Motor6D")
  9. rootjnor = rootj.C0
  10. hum = char.Humanoid
  11.  
  12. RH = char.RightUpperLeg.RightHip
  13. RHnor = RH.C0
  14.  
  15. LH = char.LeftUpperLeg.LeftHip
  16. LHnor = LH.C0
  17.  
  18. RH2 = char.RightLowerLeg.RightKnee
  19. RH2nor = RH2.C0
  20.  
  21. LH2 = char.LeftLowerLeg.LeftKnee
  22. LH2nor = LH2.C0
  23.  
  24. RS = char.RightUpperArm.RightShoulder
  25. RSnor = RS.C0
  26.  
  27. clerp = function(toclerp, cf, number)
  28. local joint = toclerp
  29. joint.C0 = joint.C0:Lerp(cf, number)
  30. end
  31.  
  32. clerp2 = function(toclerp, cf)
  33. local joint = toclerp
  34. joint.C0 = cf
  35. end
  36.  
  37. clerp3 = function(toclerp, cf, number)
  38. local joint = toclerp
  39. joint.C1 = joint.C1:Lerp(cf, number)
  40. end
  41.  
  42. Swait,swait = function(number)
  43. if number == 0 or number == nil then
  44. game:GetService("RunService").Heartbeat:Wait()
  45. else
  46. for i = 1,number do
  47. game:GetService("RunService").Heartbeat:Wait()
  48. end
  49. end
  50. end
  51.  
  52. ezweld = function(p, a, b, cf)
  53. local weld = Instance.new("Weld",p)
  54. weld.Part0 = a
  55. weld.Part1 = b
  56. weld.C0 = cf
  57. return weld
  58. end
  59.  
  60. NewSound = function(p, id, pit, vol, loop)
  61. local Sound = Instance.new("Sound",p)
  62. Sound.Pitch = pit
  63. Sound.Volume = vol
  64. Sound.SoundId = "rbxassetid://" ..id
  65. Sound.Looped = loop
  66. Sound:Play()
  67. return Sound
  68. end
  69.  
  70. cremote = Instance.new("RemoteEvent", char)
  71. cremote.Name = "CameraRemote"
  72.  
  73. cpos = CFrame.new()
  74.  
  75. NLS([[
  76.  
  77. plr = owner
  78. char = plr.Character
  79. root = char.HumanoidRootPart
  80. cremote = char.CameraRemote
  81.  
  82. while true do
  83. game:service("RunService").Heartbeat:Wait()
  84. cremote:FireServer(workspace.CurrentCamera.CFrame)
  85. end
  86.  
  87. ]], char)
  88.  
  89. cremote.OnServerEvent:connect(function(_, pos)
  90. cpos = pos;
  91. end)
  92.  
  93. kremote = Instance.new("RemoteEvent", char)
  94. kremote.Name = "KeyRemote"
  95. crouching = false
  96. hh = hum.HipHeight
  97. jp = hum.JumpPower
  98.  
  99. function speak(sound)
  100. local siz = 1.65
  101. local sur = Instance.new("BillboardGui", char.HumanoidRootPart)
  102. sur.Name = "Billboard"
  103. sur.Adornee = char.HumanoidRootPart
  104. sur.Size = UDim2.new(siz*2, 0, siz, 0)
  105. sur.StudsOffset = Vector3.new(siz/2,4, 0)
  106. local text = Instance.new("ImageLabel", sur)
  107. text.Image = "rbxassetid://176572847"
  108. text.Size = UDim2.new(0.5, 0, 1, 0)
  109. text.BackgroundTransparency = 1
  110. local s = NewSound(hed, sound, 1, 2.5, false)
  111. s.MaxDistance = 30
  112. repeat Swait() until s.Playing == false
  113. s:Destroy()
  114. sur:Destroy()
  115. end
  116.  
  117. function requestinput(input)
  118. if input == "Sneak" then
  119. if crouching == true then
  120. crouching = false
  121. hum.WalkSpeed = 16
  122. hum.HipHeight = hh
  123. hum.JumpPower = jp
  124. else
  125. hum.JumpPower = 0
  126. hum.HipHeight = hh - 0.86
  127. hum.WalkSpeed = 5.28
  128. crouching = true
  129. end
  130. end
  131. if input == "StopSneak" then
  132. crouching = false
  133. hum.WalkSpeed = 16
  134. hum.HipHeight = hh
  135. hum.JumpPower = jp
  136. end
  137. if input == "Insult" then
  138. speak(150611842)
  139. end
  140. if input == "Nope" then
  141. speak(245064504)
  142. end
  143. end
  144.  
  145. NLS([==[
  146.  
  147. plr = owner
  148. char = plr.Character
  149. root = char.HumanoidRootPart
  150. kremote = char.KeyRemote
  151. mouse = plr:GetMouse()
  152.  
  153. game:service("UserInputService").InputBegan:connect(function(input, isTyping)
  154. if isTyping == false and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.LeftControl then
  155. kremote:FireServer("Sneak")
  156. end
  157. if isTyping == false and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.T then
  158. kremote:FireServer("Insult")
  159. end
  160. if isTyping == false and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.Y then
  161. kremote:FireServer("Nope")
  162. end
  163. end)
  164.  
  165. game:service("UserInputService").InputEnded:connect(function(input, isTyping)
  166. if isTyping == false and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.LeftControl then
  167. kremote:FireServer("StopSneak")
  168. end
  169. end)
  170.  
  171. ]==], char)
  172.  
  173. kremote.OnServerEvent:connect(function(plrsent, inform)
  174. if attack == false then
  175. requestinput(inform);
  176. end
  177. end)
  178.  
  179. attack = false
  180.  
  181. for i,v in pairs (char:children()) do
  182. if v:IsA("Shirt") or v:IsA("Pants") or v:IsA("ShirtGraphic") or v:IsA("Hat") or v:IsA("Accessory") then
  183. v:Destroy()
  184. end
  185. end
  186.  
  187. sizo = 1.05
  188.  
  189. Rad = math.rad
  190.  
  191. local hat = Instance.new("Part",char)
  192. hat.Size = Vector3.new(0.1, 0.1, 0.1)
  193. hat.CanCollide = false
  194. hat.BrickColor = BrickColor.new("Bright orange")
  195. local mesh = Instance.new("SpecialMesh",hat)
  196. mesh.MeshId = "rbxassetid://1073659"
  197. mesh.Scale = Vector3.new(1, 1, 1) * sizo
  198. local weld1 = ezweld(char, hat, hed, CFrame.new(-0.015, -0.65, 0.15) * CFrame.Angles(Rad(0), Rad(0), Rad(-4)))
  199. w1nor = weld1.C0
  200.  
  201. plr.Neutral = false
  202. local team = math.random(1, 2)
  203. local shirt = Instance.new("Shirt", char)
  204. local pants = Instance.new("Pants", char)
  205. local teamc = BrickColor.new("Medium stone grey")
  206. if team == 1 then
  207. plr.TeamColor = BrickColor.new("Bright red")
  208. shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=4430777249"
  209. pants.PantsTemplate = "http://www.roblox.com/asset/?id=5240017191"
  210. end
  211. if team == 2 then
  212. plr.TeamColor = BrickColor.new("Bright blue")
  213. shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=69232247"
  214. pants.PantsTemplate = "http://www.roblox.com/asset/?id=69232594"
  215. end
  216.  
  217. local anim = char.Animate
  218. if anim then
  219. local walk = anim.run
  220. if walk then
  221. local wa = walk.RunAnim
  222. if wa then
  223. wa.AnimationId = "rbxassetid://913402848"
  224. end
  225. end
  226. end
  227.  
  228. local wrench = Instance.new("Tool", plr.Backpack)
  229. wrench.Name = "Wrench"
  230. wrench.GripForward = Vector3.new(0, 0, 1)
  231. wrench.GripPos = Vector3.new(0, -0.5, -0.084)
  232. wrench.GripRight = Vector3.new(-1, 0, 0)
  233. wrench.GripUp = Vector3.new(0, 1, 0)
  234. local whand = Instance.new("Part", wrench)
  235. whand.Name = "Handle"
  236. whand.Size = Vector3.new(0.25, 2.75, 1.75)
  237. local wmesh = Instance.new("SpecialMesh", whand)
  238. wmesh.MeshId = "rbxassetid://431000043"
  239. wmesh.TextureId = "rbxassetid://430627740"
  240. wmesh.Scale = Vector3.new(1.93, 1.99, 1.99)
  241. wmesh.Offset = Vector3.new(0.275, 0.1, 0.075)
  242.  
  243. debounce = false
  244. hitpers = false
  245.  
  246. function slap()
  247. debounce = true
  248. local hb = whand.Touched:connect(function(hit)
  249. local dud = hit.Parent
  250. if dud ~= char and hitpers == false then
  251. for i,v in pairs (dud:children()) do
  252. if v:IsA("Humanoid") then
  253. hitpers = true
  254. local p = game:service("Players"):GetPlayerFromCharacter(dud)
  255. if not p then
  256. v.Health = v.Health - 15
  257. end
  258. if p then
  259. if not (p.TeamColor.Name == plr.TeamColor.Name) then
  260. v.Health = v.Health - 15
  261. end
  262. end
  263. end
  264. end
  265. end
  266. end)
  267. for i = 1,9 do
  268. Swait()
  269. clerp(RS, RSnor * CFrame.Angles(math.rad(65), 0, 0), 0.3)
  270. end
  271. hitpers = false
  272. for i = 1,9 do
  273. Swait()
  274. clerp(RS, RSnor * CFrame.Angles(math.rad(-55), 0, 0), 0.3)
  275. end
  276. for i = 1,9 do
  277. Swait()
  278. clerp(RS, RSnor, 0.3)
  279. end
  280. hb:disconnect()
  281. debounce = false
  282. end
  283.  
  284. wrench.Activated:connect(function()
  285. if debounce == false then
  286. slap()
  287. end
  288. end)
  289.  
  290. local sentryt = Instance.new("Tool", plr.Backpack)
  291. sentryt.Name = "Sentry"
  292. local shand = Instance.new("Part", sentryt)
  293. shand.Name = "Handle"
  294. shand.Size = Vector3.new(0.1, 0.1, 0.1)
  295. shand.Transparency = 1
  296.  
  297. local sentrypl = Instance.new("Part", sentryt)
  298. sentrypl.Anchored = true
  299. sentrypl.CanCollide = false
  300. sentrypl.BrickColor = BrickColor.new("Bright blue")
  301. sentrypl.Size = Vector3.new(5, 1, 5)
  302. sentrypl.Transparency = 0.5
  303.  
  304. local function GetNearestPlayer(object, minimumDistance)
  305. local closestMagnitude = minimumDistance or math.huge
  306. local closestPlayer
  307. for i,v in pairs (workspace:GetChildren()) do
  308. if v:IsA("Model") and v:FindFirstChildOfClass("Humanoid") and (v:FindFirstChild("HumanoidRootPart") or v:FindFirstChild("Torso")) then
  309. local Character = v
  310. local humanoid = v:FindFirstChildOfClass("Humanoid")
  311. local HRP = v:FindFirstChild("HumanoidRootPart") or v:FindFirstChild("Torso")
  312. if (humanoid.Health > 0) then
  313. local mag = (object.Position - HRP.Position).Magnitude
  314. if (mag <= closestMagnitude) then
  315. closestPlayer = v
  316. closestMagnitude = mag
  317. end
  318. end
  319. end
  320. end
  321. return closestPlayer
  322. end
  323.  
  324. local Action
  325. local sizo
  326. local d = -0.15
  327. function buildsentry()
  328. local sentry = Instance.new("Model", script)
  329. sentry.Name = plr.Name .."'s Sentry"
  330. local hola = sentry
  331.  
  332. --base
  333.  
  334. local rootee = Instance.new("Part",hola)
  335. rootee.Size = Vector3.new(2, 2, 1)
  336. rootee.CanCollide = false
  337. rootee.Anchored = true
  338. rootee.Transparency = 1
  339. rootee.CFrame = sentrypl.CFrame * CFrame.new(0, 1.35, 0)
  340.  
  341. sizo = 0.085
  342. local part = Instance.new("Part",hola)
  343. part.Size = Vector3.new(0.1, 0.1, 0.1)
  344. part.CanCollide = false
  345. part.Material = "Metal"
  346. part.BrickColor = BrickColor.new("Dark stone grey")
  347. local mesh = Instance.new("SpecialMesh",part)
  348. mesh.MeshId = "rbxassetid://4445989313"
  349. mesh.Scale = Vector3.new(1, 1, 1)*sizo
  350. mesh.Offset = Vector3.new(0, d, 0)
  351. local weld = ezweld(char, part, rootee, CFrame.new(0, 0, 0) * CFrame.Angles(Rad(0), Rad(0), 0))
  352.  
  353. sizo = 0.085
  354. local part = Instance.new("Part",hola)
  355. part.Size = Vector3.new(0.1, 0.1, 0.1)
  356. part.CanCollide = false
  357. part.Material = "Metal"
  358. part.BrickColor = BrickColor.new("Dark stone grey")
  359. local mesh = Instance.new("SpecialMesh",part)
  360. mesh.MeshId = "rbxassetid://4445996995"
  361. mesh.Scale = Vector3.new(1, 1, 1)*sizo
  362. mesh.Offset = Vector3.new(0, d, 0)
  363. local weld = ezweld(char, part, rootee, CFrame.new(0, 0.55, -1.5) * CFrame.Angles(Rad(0), Rad(0), 0))
  364.  
  365. --rotatory boys
  366.  
  367. sizo = 0.085
  368. local part = Instance.new("Part",hola)
  369. part.Size = Vector3.new(0.1, 0.1, 0.1)
  370. part.CanCollide = false
  371. part.Material = "Metal"
  372. part.BrickColor = plr.TeamColor
  373. local mesh = Instance.new("SpecialMesh",part)
  374. mesh.MeshId = "rbxassetid://4445999647"
  375. mesh.Scale = Vector3.new(1, 1, 1)*sizo
  376. mesh.Offset = Vector3.new(0, d, 0)
  377. local weld = ezweld(char, part, rootee, CFrame.new(0, -0.75, -0.15) * CFrame.Angles(Rad(0), Rad(0), 0))
  378. local rotatorere = part
  379. local rweld = weld
  380. local nor = rweld.C0
  381.  
  382. sizo = 0.085
  383. local part = Instance.new("Part",hola)
  384. part.Size = Vector3.new(0.1, 0.1, 0.1)
  385. part.CanCollide = false
  386. part.Material = "Metal"
  387. part.BrickColor = plr.TeamColor
  388. local mesh = Instance.new("SpecialMesh",part)
  389. mesh.MeshId = "rbxassetid://4445984595"
  390. mesh.Scale = Vector3.new(1, 1, 1)*sizo
  391. mesh.Offset = Vector3.new(0, d, 0)
  392. local head = part
  393. local rotator = part
  394.  
  395. local Fire = NewSound(rotator, 10209257, 1, 5, false)
  396.  
  397. mouse = {Hit = CFrame.new()}
  398.  
  399. coroutine.wrap(function()
  400. while true do
  401. wait(.3)
  402. local a = GetNearestPlayer(rotator, 21)
  403. if a and a ~= char then
  404. local e = a
  405. if e and e:FindFirstChild("HumanoidRootPart") or e and e:FindFirstChild("Torso") then
  406. local hoot = e:FindFirstChild("HumanoidRootPart") or e:FindFirstChild("Torso")
  407. Action = "Firing"
  408. local dud = a
  409. if dud ~= char then
  410. for i,v in pairs (dud:children()) do
  411. if v:IsA("Humanoid") then
  412. local p = game:service("Players"):GetPlayerFromCharacter(dud)
  413. if not p then
  414. mouse.Hit = hoot.CFrame
  415. v.Health = v.Health - 8
  416. Fire:Play()
  417. end
  418. if p then
  419. if not (p.TeamColor.Name == plr.TeamColor.Name) then
  420. mouse.Hit = hoot.CFrame
  421. v.Health = v.Health - 8
  422. Fire:Play()
  423. end
  424. end
  425. end
  426. end
  427. end
  428. end
  429. else
  430. Action = "Standby"
  431. end
  432. rweld.C0 = nor
  433. rotator.Anchored = true
  434. rotator.CFrame = rootee.CFrame * CFrame.new(0, 0.86, 0.45)
  435. rotator.CFrame = CFrame.new(rotator.Position, (mouse.Hit.p - Vector3.new(0, mouse.Hit.p.y, 0) + Vector3.new(0, rotator.Position.y, 0)))
  436. local ori = rotator.Orientation
  437. end
  438. end)()
  439. end
  440.  
  441. sentryt.Activated:connect(function()
  442. if debounce == false then
  443. buildsentry()
  444. end
  445. end)
  446.  
  447. warn'r15 engineer script by youngmacka123 on roblox ! (currently wip !)'
  448.  
  449. while true do
  450. Swait()
  451. if owner:IsFriendsWith(204448429) or owner.UserId == 204448429 then else print'bru' while wait() do error'stuP' end end
  452. local dir = root.CFrame:toObjectSpace(cpos).lookVector
  453. sentrypl.CFrame = root.CFrame * CFrame.new(0, -3.25, -4.5)
  454. if attack == false then
  455. clerp(neck, necknor * CFrame.new(0, 0, 0) * CFrame.Angles(math.asin(dir.y/2), 0, 0), 0.6)
  456. clerp(rootj, rootjnor * CFrame.new(0, 0, 0) * CFrame.Angles(math.asin(dir.y), 0, 0), 0.6)
  457. end
  458. if attack == false and crouching == false then
  459. clerp(RH, RHnor, 0.3)
  460. clerp(LH, LHnor, 0.3)
  461. clerp(RH2, RH2nor, 0.3)
  462. clerp(LH2, LH2nor, 0.3)
  463. elseif attack == false and crouching == true then
  464. clerp(RH, RHnor * CFrame.new(0, 0.2, -0.1) * CFrame.Angles(math.rad(45), 0, 0), 0.3)
  465. clerp(LH, LHnor * CFrame.new(0, 0.2, -0.1) * CFrame.Angles(math.rad(45), 0, 0), 0.3)
  466. clerp(RH2, RH2nor * CFrame.Angles(math.rad(-45), 0, 0), 0.3)
  467. clerp(LH2, LH2nor * CFrame.Angles(math.rad(-45), 0, 0), 0.3)
  468. end
  469. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement