Advertisement
HenloMyDude

MR WARE GOES TO THE STREETS (WIP)

Oct 18th, 2019
707
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.91 KB | None | 0 0
  1.  
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152.  
  153. local plr = owner
  154. local mouse = plr:GetMouse()
  155. plr:ClearCharacterAppearance()
  156. local char = plr.Character
  157. local attack = false
  158. local hum = char.Humanoid
  159. local RS = char.Torso["Right Shoulder"]
  160. local LS = char.Torso["Left Shoulder"]
  161. local RH = char.Torso["Right Hip"]
  162. local LH = char.Torso["Left Hip"]
  163. local neck = char.Torso["Neck"]
  164. local anim = char.Animate
  165. local rootj = char.HumanoidRootPart.RootJoint
  166. local timepos = 0
  167. local sine = 0
  168. local RSnor = RS.C0
  169. local LSnor = LS.C0
  170. local RHnor = RH.C0
  171. local LHnor = LH.C0
  172. local rootjnor = rootj.C0
  173. local necknor = neck.C0
  174. local hed = char.Head
  175.  
  176. hats = Instance.new("Model",char)
  177. hats2 = Instance.new("Model",hats)
  178.  
  179. NewSound = function(p, id, pit, vol, loop)
  180. local Sound = Instance.new("Sound",p)
  181. Sound.Pitch = pit
  182. Sound.Volume = vol
  183. Sound.SoundId = "rbxassetid://" ..id
  184. Sound.Looped = loop
  185. Sound:Play()
  186. return Sound
  187. end
  188.  
  189. NewInstance = function(instance,parent,properties)
  190. local inst = Instance.new(instance)
  191. inst.Parent = parent
  192. if(properties)then
  193. for i,v in next, properties do
  194. pcall(function() inst[i] = v end)
  195. end
  196. end
  197. return inst;
  198. end
  199.  
  200. ezweld = function(p, a, b, cf)
  201. local weld = Instance.new("Weld",p)
  202. weld.Part0 = a
  203. weld.Part1 = b
  204. weld.C0 = cf
  205. return weld
  206. end
  207.  
  208. cam = workspace.CurrentCamera
  209. CF = CFrame.new
  210. angles = CFrame.Angles
  211. attack = false
  212. Euler = CFrame.fromEulerAnglesXYZ
  213. Rad = math.rad
  214. IT = Instance.new
  215. BrickC = BrickColor.new
  216. Cos = math.cos
  217. Acos = math.acos
  218. Sin = math.sin
  219. Asin = math.asin
  220. Abs = math.abs
  221. Mrandom = math.random
  222. Floor = math.floor
  223. Animation_Speed = 1 / 60
  224. ammo = 20
  225.  
  226. bighead = Instance.new("Part",hats2)
  227. bighead.CanCollide = false
  228. bighead.Size = Vector3.new(0.1, 0.1, 0.1)
  229. bighead.Name = "OofHead"
  230. bigmesh = Instance.new("SpecialMesh",bighead)
  231. bigmesh.MeshId = "rbxassetid://1047997"
  232. bigmesh.TextureId = "rbxassetid://606673948"
  233. --bigweld = ezweld(char, bighead, hed, CFrame.new(0, -0.45, 0))
  234.  
  235. bomb = Instance.new("Part",hats2)
  236. bomb.CanCollide = false
  237. bomb.Size = Vector3.new(0.1, 0.1, 0.1)
  238. bomb.Name = "Bom"
  239. bombmesh = Instance.new("SpecialMesh",bomb)
  240. bombmesh.MeshId = "rbxasset://fonts/timebomb.mesh"
  241. bombmesh.TextureId = "rbxasset://textures/bombtex.png"
  242. bombmesh.Scale = Vector3.new(0.8, 0.8, 0.8)
  243. bombweld = ezweld(char, bomb, bighead, CFrame.new(0, 0, 0) * CFrame.Angles(77, 77, 0))
  244.  
  245. local Hats = bighead
  246. local HatsWeld = IT("Weld")
  247. HatsWeld.Parent = hed
  248. HatsWeld.Part0 = hed
  249. HatsWeld.Part1 = Hats
  250. HatsWeld.C0 = CF(0, 0.4, -0.1) * angles(Rad(0), Rad(0), Rad(0))
  251. print(owner.Character.Animate.toolnone.ToolNoneAnim.AnimationId)
  252. char.Humanoid.WalkSpeed = 0
  253. char.Humanoid.Jump = false
  254. char.Animate.idle.Animation1.AnimationId = "rbxassetid://182393478"
  255. local holdanim = hum:LoadAnimation(char.Animate.idle.Animation1)
  256. holdanim:Play()
  257. char.Animate.idle.Animation2.AnimationId = "rbxassetid://182393478"
  258. --wait(0.25)
  259. NLS([[
  260. while wait() do
  261. owner.Character["Right Arm"].LocalTransparencyModifier = 0
  262. --owner.Character["Left Arm"].LocalTransparencyModifier = 0
  263. --owner.Character["Right Leg"].LocalTransparencyModifier = 0
  264. --owner.Character["Left Leg"].LocalTransparencyModifier = 0
  265. --owner.Character["Torso"].LocalTransparencyModifier = 1
  266. end
  267. ]],char)
  268.  
  269. char.Animate:Destroy()
  270. hum.WalkSpeed = 16
  271. pequip = false
  272. doarm = false
  273. psize = 0.05
  274.  
  275. aheh = Instance.new("Model",char)
  276. aheh.Name = "Weapons"
  277. pistol = Instance.new("Part",workspace)
  278. pistol.Transparency = 1
  279. pistol.CanCollide = true
  280. pistol.Size = Vector3.new(0.1, 0.1, 0.1)
  281. pistol.Name = "Pistol"
  282. pmesh = Instance.new("SpecialMesh",pistol)
  283. pmesh.MeshId = "rbxassetid://468351345"
  284. pmesh.TextureId = "rbxassetid://468351348"
  285. pmesh.Scale = Vector3.new(psize, psize, psize)
  286. pwld = ezweld(char, pistol, char["Right Arm"],CFrame.new(-1.25, -0.5, 0) * CFrame.Angles(77, 0, 77))
  287.  
  288. function poostal()
  289. if pequip then
  290. doarm = false
  291. pequip = false
  292. pistol.Transparency = 1
  293. else
  294. doarm = true
  295. pequip = true
  296. pistol.Transparency = 0
  297. end
  298. end
  299.  
  300. function crit(part)
  301. local sur = Instance.new("BillboardGui", part)
  302. sur.Name = "Billboard"
  303. sur.Adornee = part
  304. sur.Size = UDim2.new(10, 0, 5, 0)
  305. sur.StudsOffset = Vector3.new(0, 5, 0)
  306. local text = Instance.new("TextLabel", sur)
  307. text.Text = "CRITICAL!"
  308. text.Size = UDim2.new(1, 0, 1, 0)
  309. text.TextScaled = true
  310. text.BackgroundTransparency = 1
  311. text.Font = Enum.Font.SourceSansLight
  312. text.TextColor3 = Color3.new(1, 0, 0)
  313. text.TextStrokeTransparency = 0
  314. game.Debris:AddItem(sur, 5)
  315. end
  316.  
  317. function MouseDown(Key)
  318. if pequip and mouse.Target then
  319. local target = mouse.Target
  320. NewSound(hed, 2314169572, 1, 0.5, false)
  321. for _,v in pairs (target.Parent:GetChildren()) do
  322. if v:IsA("Humanoid") then
  323. v.Health = v.Health - 15
  324. end
  325. end
  326. if target.Name == "Head" then
  327. target:BreakJoints()
  328. print("CRITICAL!")
  329. crit(target)
  330. end
  331. end
  332. end
  333.  
  334. function KeyDown(Key)
  335. if Key == "p" then
  336. poostal()
  337. end
  338. end
  339.  
  340. mouse.KeyDown:connect(function(NEWKEY)
  341. KeyDown(NEWKEY)
  342. end)
  343.  
  344. mouse.Button1Down:connect(function(NEWKEY)
  345. MouseDown(NEWKEY)
  346. end)
  347.  
  348. while true do
  349. wait()
  350. sine = sine + 1
  351. spd = hum.WalkSpeed - 15 + 0.15
  352. spd2 = hum.WalkSpeed - 15 + 3
  353. speedval = 6 / (hum.WalkSpeed / 16)
  354. wld = char.Torso['Right Shoulder']
  355. tframe = char.Torso.CFrame
  356. local taim = mouse.Hit.p -( tframe.p )
  357. if attack == false and doarm == true then
  358. wld.C0 = (CFrame.new(Vector3.new(),tframe:vectorToObjectSpace(taim))*CFrame.Angles(0,math.pi/2,0))+Vector3.new( 1, 0.5, 0 ),1 / Animation_Speed
  359. end
  360. if(not char:FindFirstChildOfClass'Shirt')then
  361. NewInstance("Shirt",char,{ShirtTemplate='rbxassetid://131666081'})
  362. else
  363. char:FindFirstChildOfClass'Shirt'.ShirtTemplate='rbxassetid://131666081'
  364. end
  365. if(not char:FindFirstChildOfClass'Pants')then
  366. NewInstance("Pants",char,{PantsTemplate='rbxassetid://131667111'})
  367. else
  368. char:FindFirstChildOfClass'Pants'.PantsTemplate='rbxassetid://131667111'
  369. end
  370. if char.HumanoidRootPart.Velocity.Magnitude > 1 then
  371. animpose = "Walking"
  372. else
  373. animpose = "Idle"
  374. end
  375. if animpose == "Idle" then
  376. armrad = 0.17
  377. headrad = -0.2
  378. neck.C0 = neck.C0:Lerp(necknor * CFrame.new() * CFrame.Angles(0 + headrad * Cos(sine / 7), 0 + headrad * Cos(sine / 7), 0 + headrad * Cos(sine / 7)), 0.15)
  379. LH.C0 = LH.C0:Lerp(LHnor * CFrame.new() * CFrame.Angles(0, 0.3, 0), 0.15)
  380. RH.C0 = RH.C0:Lerp(RHnor * CFrame.new() * CFrame.Angles(0, -0.3, 0), 0.15)
  381. LS.C0 = LS.C0:Lerp(LSnor * CFrame.new() * CFrame.Angles(0 + armrad * Cos(sine / 7), 0 + armrad * Cos(sine / 7), 0 + armrad * Cos(sine / 7)), 0.15)
  382. if doarm == false then
  383. RS.C0 = RS.C0:Lerp(RSnor * CFrame.new() * CFrame.Angles(0, 0, -77) * CFrame.Angles(0 + armrad * Cos(sine / 7), 0 + armrad * Cos(sine / 7), 0 + armrad * Cos(sine / 7)), 0.15)
  384. end
  385. rootj.C0 = rootj.C0:Lerp(rootjnor * CFrame.new() * CFrame.Angles(0, 0, 0), 0.15)
  386. end
  387. if animpose == "Walking" then
  388. neck.C0 = neck.C0:Lerp(necknor * CFrame.new() * CFrame.Angles(-0.15, 0, 0), 0.15)
  389. LH.C0 = LH.C0:Lerp(LHnor * CFrame.new(0 + 0.15 * Cos(sine / speedval), 0, 0) * CFrame.Angles(0, 0, 0.35 + 1 * Cos(sine / speedval)), 0.15)
  390. RH.C0 = RH.C0:Lerp(RHnor * CFrame.new(0 + 0.15 * Cos(sine / speedval), 0, 0) * CFrame.Angles(0, 0, -0.35 + 1 * Cos(sine / speedval)), 0.15)
  391. LS.C0 = LS.C0:Lerp(LSnor * CFrame.new() * CFrame.Angles(0, 0, 0 + 1 * Cos(sine / speedval)), 0.15)
  392. if doarm == false then
  393. RS.C0 = RS.C0:Lerp(RSnor * CFrame.new() * CFrame.Angles(0, 0, -77) * CFrame.Angles(0, 0, 0 + 1 * Cos(sine / speedval)), 0.15)
  394. end
  395. rootj.C0 = rootj.C0:Lerp(rootjnor * CFrame.new() * CFrame.Angles(0.15, 0, 0), 0.15)
  396. end
  397. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement