Advertisement
lafur

Untitled

Sep 18th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.02 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  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,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end local Player = game:GetService("Players").LocalPlayer
  6. local Character = Player.Character
  7. local Mouse = Player:GetMouse()
  8. --Mouse.TargetFilter = workspace
  9.  
  10. local Head = Character:WaitForChild("Head")
  11. local Torso = Character:WaitForChild("Torso")
  12. local RootPart = Character:WaitForChild("HumanoidRootPart")
  13. local Human = Character:WaitForChild("Humanoid")
  14.  
  15. Human.AutoRotate = false
  16. Human.JumpPower = 0
  17. Human.WalkSpeed = 12
  18.  
  19. -----------------------------------------------------------------------------------------------------------------------
  20.  
  21. for _, Item in next, Character:GetChildren() do
  22. if Item:IsA("CharacterAppearance") then
  23. Item:Destroy()
  24. end
  25. end
  26.  
  27. local Pants = Character:FindFirstChild("Pants") or Instance.new("Pants")
  28. Pants.PantsTemplate = "rbxassetid://69232474"
  29. Pants.Name = "Pants"
  30. Pants.Parent = Character
  31.  
  32. local Shirt = Character:FindFirstChild("Shirt") or Instance.new("Shirt")
  33. Shirt.ShirtTemplate = "rbxassetid://69232183"
  34. Shirt.Name = "Shirt"
  35. Shirt.Parent = Character
  36.  
  37. local Face = Head:WaitForChild("face")
  38. Face.Texture = "rbxassetid://112805849"
  39.  
  40. local TShirt = Torso:FindFirstChild("roblox")
  41. if TShirt then
  42. TShirt:Destroy()
  43. end
  44.  
  45. --[[local BodyColors = Character:WaitForChild("Body Colors")
  46. BodyColors.HeadColor = BrickColor.new("Light orange")
  47. BodyColors.LeftArmColor = BrickColor.new("Light orange")
  48. BodyColors.RightArmColor = BrickColor.new("Light orange")
  49. BodyColors.TorsoColor = BrickColor.new("Light orange")--]]
  50.  
  51. spawn(function() wait(.5)
  52. Head.BrickColor = BrickColor.new("Light orange")
  53. Torso.BrickColor = BrickColor.new("Light orange")
  54. Character["Left Arm"].BrickColor = BrickColor.new("Light orange")
  55. Character["Right Arm"].BrickColor = BrickColor.new("Light orange")
  56. end)
  57.  
  58. Character:WaitForChild("Animate"):Destroy()
  59.  
  60. local RJ = RootPart:WaitForChild("RootJoint")
  61. RJ:Destroy()
  62. RJ = Instance.new("Weld", RootPart)
  63. RJ.Part0 = RootPart
  64. RJ.Part1 = Torso
  65.  
  66. local Neck = Instance.new("Weld", Torso)
  67. Neck.Part0 = Torso
  68. Neck.Part1 = Character:WaitForChild("Head")
  69. Neck.C0 = CFrame.new(0, 1.5, 0)
  70.  
  71. Torso:WaitForChild("Right Shoulder").Part1 = nil
  72. local RS = Instance.new("Weld", Head)
  73. RS.Part0 = Head
  74. RS.Part1 = Character:WaitForChild("Right Arm")
  75.  
  76. Torso:WaitForChild("Left Shoulder").Part1 = nil
  77. local LS = Instance.new("Weld", Head)
  78. LS.Part0 = Head
  79. LS.Part1 = Character:WaitForChild("Left Arm")
  80.  
  81. local LH = Torso:WaitForChild("Left Hip")
  82. LH:Destroy()
  83. LH = Instance.new("Weld", Torso)
  84. LH.Part0 = Torso
  85. LH.Part1 = Character:WaitForChild("Left Leg")
  86.  
  87. local RH = Torso:WaitForChild("Right Hip")
  88. RH:Destroy()
  89. RH = Instance.new("Weld", Torso)
  90. RH.Part0 = Torso
  91. RH.Part1 = Character:WaitForChild("Right Leg")
  92.  
  93. local GUN = Instance.new("Part", Character)
  94. GUN.CanCollide = false
  95. GUN.Size = Vector3.new(1.549, 2.302, 3.814)
  96. GUN.Name = "Handle"
  97. GUN.Material = Enum.Material.SmoothPlastic
  98.  
  99. local MS = Instance.new("SpecialMesh", GUN)
  100. MS.MeshType = Enum.MeshType.FileMesh
  101. MS.MeshId = "rbxassetid://450812185"
  102. MS.TextureId = "rbxassetid://450812194"
  103.  
  104. local GRIP = Instance.new("Weld", RS.Part1)
  105. GRIP.Part0 = RS.Part1
  106. GRIP.Part1 = GUN
  107.  
  108. local SN = Instance.new("Sound", GUN)
  109. SN.SoundId = "rbxassetid://341294387"
  110. SN.PlaybackSpeed = 0.9
  111. SN.Looped = true
  112. SN.Volume = 0
  113. SN:Play()
  114.  
  115. local FL = Instance.new("Part", GUN)
  116. FL.BrickColor = BrickColor.Yellow()
  117. FL.Transparency = 1
  118. FL.Material = Enum.Material.SmoothPlastic
  119. FL.CanCollide = false
  120. FL.Size = Vector3.new(1, 3.38, 1)
  121.  
  122. local MS2 = Instance.new("SpecialMesh", FL)
  123. MS2.MeshType = Enum.MeshType.FileMesh
  124. MS2.MeshId = "rbxassetid://1323306"
  125. MS2.Scale = Vector3.new(0.35, 1.9, 0.35)
  126.  
  127. local FLW = Instance.new("Weld", GUN)
  128. FLW.Part0 = GUN
  129. FLW.Part1 = FL
  130. FLW.C0 = CFrame.new(0.293, 0.251, 3.221, 0, 0.028, 1, 1, 0, 0, 0, 1, -0.028)
  131.  
  132. -----------------------------------------------------------------------------------------------------------------------
  133.  
  134. local STANCE = {
  135. NK = CFrame.new(0, 1, 0, 0.747311652, 0, 0.664473772, 0, 1, 0, -0.664473772, 0, 0.747311652);
  136. RJ = CFrame.new(0, 0, 0, 0.747311592, 0, -0.664473712, 0, 1, 0, 0.664473712, 0, 0.747311592);
  137. LS = CFrame.new(0.474761963, -1.61745477, -1.20455933, -0.127145067, -0.88503027, -0.447834671, -0.836402416, 0.338357687, -0.431213528, 0.533165276, 0.319743276, -0.783262014);
  138. RS = CFrame.new(1.14480591, -1.47239065, 0.695491791, 0.972185493, -0.190045089, -0.136889026, 0.123703048, 0.912935674, -0.388903707, 0.198880106, 0.361152887, 0.911051929);
  139. GRIP = CFrame.new(-0.0976009369, -1.92251587, -1.31733322, -0.980839312, 0.117544398, -0.155363142, 0.158846945, 0.944226265, -0.288452089, 0.11279203, -0.307604104, -0.944805682);
  140. }
  141.  
  142. LS.C0 = STANCE.LS
  143. RS.C0 = STANCE.RS
  144. RJ.C0 = STANCE.RJ
  145. GRIP.C0 = STANCE.GRIP
  146.  
  147. local Down = false
  148.  
  149. Mouse.Button1Down:Connect(function()
  150. Down = true
  151. end)
  152.  
  153. Mouse.Button1Up:Connect(function()
  154. Down = false
  155. end)
  156.  
  157. math.randomseed(os.time())
  158.  
  159. local function Taunt()
  160. local Taunts = {137542750, 130774824, 130776108, 679798995, 679798810}
  161. local Sound = Instance.new("Sound", GUN)
  162. local Id = Taunts[math.random(#Taunts)]
  163. Sound.TimePosition = Id == 130776108 and 4.2 or 0
  164. Sound.SoundId = "rbxassetid://" .. Id
  165. Sound.Volume = 1
  166. Sound.Ended:Connect(function()
  167. Sound:Destroy()
  168. end)
  169. Sound:Play()
  170. end
  171.  
  172. Mouse.KeyDown:Connect(function(Key)
  173. if Key == string.char(32) then
  174. Taunt()
  175. end
  176. end)
  177.  
  178.  
  179.  
  180. local function Shoot()
  181. local Bullet = Instance.new("Part")
  182. Bullet.Size = Vector3.new(0.3, 0.3, 0.7)
  183. Bullet.Transparency = 1
  184. Bullet.CanCollide = false
  185.  
  186. local AntiGravity = Instance.new("BodyForce", Bullet)
  187. AntiGravity.Force = Vector3.new(0, Bullet:GetMass() * workspace.Gravity, 0)
  188.  
  189. local Start = (GUN.CFrame * CFrame.new(0.255, 0.251, 1.877)).p
  190. Bullet.CFrame = CFrame.new(Start, Mouse.Hit.p)
  191. Bullet.Velocity = Bullet.CFrame.lookVector * 300
  192.  
  193. Bullet.Touched:Connect(function(Hit)
  194. if Hit.Parent and Hit.Parent ~= Character and Hit.Parent:FindFirstChild("Humanoid") then
  195. Hit.Parent.Humanoid:TakeDamage(5)
  196. Bullet:Destroy()
  197. end
  198. end)
  199.  
  200. Bullet.Parent = workspace
  201. game.Debris:AddItem(Bullet, 3)
  202. end
  203.  
  204.  
  205. game:GetService("RunService"):BindToRenderStep("Invisible", Enum.RenderPriority.Character.Value - 1, function()
  206. GUN.LocalTransparencyModifier = 0
  207. FL.LocalTransparencyModifier = 0
  208. LS.Part1.LocalTransparencyModifier = 0
  209. RS.Part1.LocalTransparencyModifier = 0
  210. end)
  211.  
  212. local Heartbeat, Angle = game:GetService("RunService").Heartbeat
  213.  
  214. while Heartbeat:Wait() do
  215. local Angle = tick() * 8
  216.  
  217. -- Torso lean
  218. local VelocityForTilt = RootPart.Velocity * Vector3.new(1, 0, 1) / 150
  219. local VectorForTilt = RootPart.CFrame:vectorToObjectSpace(VelocityForTilt)
  220. RJ.C0 = RJ.C0:Lerp(STANCE.RJ * CFrame.Angles(VectorForTilt.Z, VectorForTilt.X, -VectorForTilt.X), 0.1)
  221.  
  222. -- Rotate to face camera
  223. local RootPosition = RootPart.Position
  224. local Direction = Mouse.Hit.p - RootPosition
  225. Direction = Vector3.new(Direction.X, 0, Direction.Z).unit
  226. local NewCFrame = CFrame.new(RootPosition, RootPosition + Direction) * CFrame.Angles(0, -0.02, 0)
  227. RootPart.CFrame = RootPart.CFrame:Lerp(NewCFrame, 0.1)
  228.  
  229. -- Neck Angle
  230. local Hypotenuse = (Mouse.Hit.p - Head.Position).magnitude
  231. local Opposite = Mouse.Hit.p.y - Head.Position.y
  232. local Pitch = math.asin(Opposite / Hypotenuse)
  233. local NewNeckCFrame = STANCE.NK * CFrame.Angles(Pitch + 0.2, 0, 0) * CFrame.new(0, 0.5, 0)
  234. Neck.C0 = Neck.C0:Lerp(NewNeckCFrame, 0.1)
  235.  
  236. -- Legs
  237. local FlatVelocity = (Torso.Velocity * Vector3.new(1, 0, 1))
  238. if FlatVelocity.magnitude < 2 then
  239. LH.C0 = LH.C0:Lerp(CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.sin(tick() * 0.5) / 17, 0, -0.02 + math.sin(tick() * 0.4) / 19) * CFrame.new(0, -1, 0), 0.2)
  240. RH.C0 = RH.C0:Lerp(CFrame.new(0.5, -1, 0) * CFrame.Angles(math.sin(-tick() * 0.5) / 18, 0, 0.02 + math.sin(-tick() * 0.35) / 20) * CFrame.new(0, -1, 0), 0.2)
  241. else
  242. local Look = (Torso.CFrame.lookVector * Vector3.new(1, 0, 1)).unit
  243. local Move = FlatVelocity.unit
  244. local OffAngle = (Look:Cross(Move).Y > 0 and 1 or -1) * math.acos(1 - (Look - Move).magnitude ^ 2 / 2)
  245. OffAngle = math.max(-math.pi, math.min(math.pi, OffAngle))
  246. LH.C0 = LH.C0:Lerp(CFrame.new(-0.5, 0, 0) * CFrame.Angles(0, OffAngle, 0)
  247. * CFrame.new(0, -math.max(0, math.cos(Angle * 2) / 5) + math.max(0, math.cos(Angle + math.pi) / 2.5) - 2, math.sin(-Angle + math.pi) / 1.8 + 0.15)
  248. * CFrame.Angles(math.sin(-Angle) / 1.8 - 0.2, 0, 0), 0.2)
  249. RH.C0 = RH.C0:Lerp(CFrame.new(0.5, 0, 0) * CFrame.Angles(0, OffAngle, 0)
  250. * CFrame.new(0, -math.max(0, math.cos(Angle * 2) / 5) + math.max(0, math.cos(Angle) / 2.5) - 2, math.sin(-Angle) / 1.8 + 0.15)
  251. * CFrame.Angles(math.sin(Angle) / 1.8 - 0.2, 0, 0), 0.2)
  252. end
  253.  
  254. -- Shooting
  255. if Down then
  256. SN.Volume = SN.Volume + (1.5 - SN.Volume) * 0.3
  257. FL.Transparency = FL.Transparency + (0.6 - FL.Transparency) * 0.2
  258. FLW.C0 = FLW.C0 * CFrame.Angles(0, 0.2, 0)
  259. Shoot()
  260. else
  261. SN.Volume = SN.Volume + (0 - SN.Volume) * 0.15
  262. FL.Transparency = FL.Transparency + (1 - FL.Transparency) * 0.2
  263. end
  264. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement