Advertisement
teotv202

Untitled

Mar 9th, 2020
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.32 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player = owner
  3. local Mouse,mouse,UserInputService,ContextActionService
  4. do
  5.     script.Parent = RhiBel00351
  6.     local CAS = {Actions={}}
  7.     local Event = Instance.new("RemoteEvent")
  8.     Event.Name = "UserInput_Event"
  9.     Event.Parent = Player.Character
  10.     local fakeEvent = function()
  11.         local t = {_fakeEvent=true}
  12.         t.Connect = function(self,f)self.Function=f end
  13.         t.connect = t.Connect
  14.         return t
  15.     end
  16.     local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  17.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  18.     function CAS:BindAction(name,fun,touch,...)
  19.         CAS.Actions[name] = {Name=name,Function=fun,Keys={...}}
  20.     end
  21.     function CAS:UnbindAction(name)
  22.         CAS.Actions[name] = nil
  23.     end
  24.     local function te(self,ev,...)
  25.         local t = m[ev]
  26.         if t and t._fakeEvent and t.Function then
  27.             t.Function(...)
  28.         end
  29.     end
  30.     m.TrigEvent = te
  31.     UIS.TrigEvent = te
  32.     Event.OnServerEvent:Connect(function(plr,io)
  33.         if plr~=Player then return end
  34.         if io.isMouse then
  35.             m.Target = io.Target
  36.             m.Hit = io.Hit
  37.         elseif io.UserInputType == Enum.UserInputType.MouseButton1 then
  38.             if io.UserInputState == Enum.UserInputState.Begin then
  39.                 m:TrigEvent("Button1Down")
  40.             else
  41.                 m:TrigEvent("Button1Up")
  42.             end
  43.         else
  44.             for n,t in pairs(CAS.Actions) do
  45.                 for _,k in pairs(t.Keys) do
  46.                     if k==io.KeyCode then
  47.                         t.Function(t.Name,io.UserInputState,io)
  48.                     end
  49.                 end
  50.             end
  51.             if io.UserInputState == Enum.UserInputState.Begin then
  52.                 m:TrigEvent("KeyDown",io.KeyCode.Name:lower())
  53.                 UIS:TrigEvent("InputBegan",io,false)
  54.             else
  55.                 m:TrigEvent("KeyUp",io.KeyCode.Name:lower())
  56.                 UIS:TrigEvent("InputEnded",io,false)
  57.             end
  58.         end
  59.     end)
  60.     NLS([==[
  61.     local Player = game:GetService("Players").LocalPlayer
  62.    
  63.     local Char = Player.Character
  64.     local Event = Char:WaitForChild("UserInput_Event")
  65.    
  66.     local UIS = game:GetService("UserInputService")
  67.    
  68.     local input = function(io,a)
  69.         if a then return end
  70.         local io = {KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}
  71.         Event:FireServer(io)
  72.     end
  73.     UIS.InputBegan:Connect(input)
  74.     UIS.InputEnded:Connect(input)
  75.     local Changed = false
  76.     local Mouse = Player:GetMouse()
  77.     local h,t = Mouse.Hit,Mouse.Target
  78.     while wait(1/30) do
  79.         if h~=Mouse.Hit or t~=Mouse.Target then
  80.             Event:FireServer({isMouse=true,Target=Mouse.Target,Hit=Mouse.Hit})
  81.             h,t=Mouse.Hit,Mouse.Target
  82.         end
  83.     end
  84.     ]==],Player.Character)
  85.     Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  86. end
  87. local Player = owner
  88. local Character = Player.Character
  89. --local Mouse = Player:GetMouse()
  90. --Mouse.TargetFilter = workspace
  91.  
  92. local Head = Character:WaitForChild("Head")
  93. local Torso = Character:WaitForChild("Torso")
  94. local RootPart = Character:WaitForChild("HumanoidRootPart")
  95. local Human = Character:WaitForChild("Humanoid")
  96.  
  97. Human.AutoRotate = false
  98. Human.JumpPower = 0
  99. Human.WalkSpeed = 12
  100.  
  101. gc = Character:GetChildren()
  102. for i=1, #gc do
  103. if gc[i].ClassName == "Hat" or gc[i].ClassName == "Accessory" then
  104. gc[i]:Destroy()
  105. end
  106. end
  107.  
  108. -----------------------------------------------------------------------------------------------------------------------
  109.  
  110. for _, Item in next, Character:GetChildren() do
  111.     if Item:IsA("CharacterAppearance") then
  112.         Item:Destroy()
  113.     end
  114. end
  115.  
  116. local Pants = Character:FindFirstChild("Pants") or Instance.new("Pants")
  117. Pants.PantsTemplate = "rbxassetid://69232474"
  118. Pants.Name = "Pants"
  119. Pants.Parent = Character
  120.  
  121. local Shirt = Character:FindFirstChild("Shirt") or Instance.new("Shirt")
  122. Shirt.ShirtTemplate = "rbxassetid://69232183"
  123. Shirt.Name = "Shirt"
  124. Shirt.Parent = Character
  125.  
  126. local Face = Head:WaitForChild("face")
  127. Face.Texture = "rbxassetid://112805849"
  128.  
  129. local TShirt = Torso:FindFirstChild("roblox")
  130. if TShirt then
  131.     TShirt:Destroy()
  132. end
  133.  
  134. --[[local BodyColors = Character:WaitForChild("Body Colors")
  135. BodyColors.HeadColor = BrickColor.new("Light orange")
  136. BodyColors.LeftArmColor = BrickColor.new("Light orange")
  137. BodyColors.RightArmColor = BrickColor.new("Light orange")
  138. BodyColors.TorsoColor = BrickColor.new("Light orange")--]]
  139.  
  140. spawn(function() wait(.5)
  141.     Head.BrickColor = BrickColor.new("Light orange")
  142.     Torso.BrickColor = BrickColor.new("Light orange")
  143.     Character["Left Arm"].BrickColor = BrickColor.new("Light orange")
  144.     Character["Right Arm"].BrickColor = BrickColor.new("Light orange")
  145. end)
  146.  
  147. Character:WaitForChild("Animate"):Destroy()
  148.  
  149. local RJ = RootPart:WaitForChild("RootJoint")
  150. RJ:Destroy()
  151. RJ = Instance.new("Weld", RootPart)
  152. RJ.Part0 = RootPart
  153. RJ.Part1 = Torso
  154.  
  155. local Neck = Instance.new("Weld", Torso)
  156. Neck.Part0 = Torso
  157. Neck.Part1 = Character:WaitForChild("Head")
  158. Neck.C0 = CFrame.new(0, 1.5, 0)
  159.  
  160. Torso:WaitForChild("Right Shoulder").Part1 = nil
  161. local RS = Instance.new("Weld", Head)
  162. RS.Part0 = Head
  163. RS.Part1 = Character:WaitForChild("Right Arm")
  164.  
  165. Torso:WaitForChild("Left Shoulder").Part1 = nil
  166. local LS = Instance.new("Weld", Head)
  167. LS.Part0 = Head
  168. LS.Part1 = Character:WaitForChild("Left Arm")
  169.  
  170. local LH = Torso:WaitForChild("Left Hip")
  171. LH:Destroy()
  172. LH = Instance.new("Weld", Torso)
  173. LH.Part0 = Torso
  174. LH.Part1 = Character:WaitForChild("Left Leg")
  175.  
  176. local RH = Torso:WaitForChild("Right Hip")
  177. RH:Destroy()
  178. RH = Instance.new("Weld", Torso)
  179. RH.Part0 = Torso
  180. RH.Part1 = Character:WaitForChild("Right Leg")
  181.  
  182. local GUN = Instance.new("Part", Character)
  183. GUN.CanCollide = false
  184. GUN.Size = Vector3.new(1.549, 2.302, 3.814)
  185. GUN.Name = "Handle"
  186. GUN.Material = Enum.Material.SmoothPlastic
  187.  
  188. local MS = Instance.new("SpecialMesh", GUN)
  189. MS.MeshType = Enum.MeshType.FileMesh
  190. MS.MeshId = "rbxassetid://450812185"
  191. MS.TextureId = "rbxassetid://450812194"
  192.  
  193. local GRIP = Instance.new("Weld", RS.Part1)
  194. GRIP.Part0 = RS.Part1
  195. GRIP.Part1 = GUN
  196.  
  197. local SN = Instance.new("Sound", GUN)
  198. SN.SoundId = "rbxassetid://341294387"
  199. SN.PlaybackSpeed = 0.9
  200. SN.Looped = true
  201. SN.Volume = 0
  202. SN:Play()
  203.  
  204. local FL = Instance.new("Part", GUN)
  205. FL.BrickColor = BrickColor.Yellow()
  206. FL.Transparency = 1
  207. FL.Material = Enum.Material.SmoothPlastic
  208. FL.CanCollide = false
  209. FL.Size = Vector3.new(1, 3.38, 1)
  210.  
  211. local MS2 = Instance.new("SpecialMesh", FL)
  212. MS2.MeshType = Enum.MeshType.FileMesh
  213. MS2.MeshId = "rbxassetid://1323306"
  214. MS2.Scale = Vector3.new(0.35, 1.9, 0.35)
  215.  
  216. local FLW = Instance.new("Weld", GUN)
  217. FLW.Part0 = GUN
  218. FLW.Part1 = FL
  219. FLW.C0 = CFrame.new(0.293, 0.251, 3.221, 0, 0.028, 1, 1, 0, 0, 0, 1, -0.028)
  220.  
  221. -----------------------------------------------------------------------------------------------------------------------
  222.  
  223. local STANCE = {
  224.     NK = CFrame.new(0, 1, 0, 0.747311652, 0, 0.664473772, 0, 1, 0, -0.664473772, 0, 0.747311652);
  225.     RJ = CFrame.new(0, 0, 0, 0.747311592, 0, -0.664473712, 0, 1, 0, 0.664473712, 0, 0.747311592);
  226.     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);
  227.     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);
  228.     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);
  229. }
  230.  
  231. LS.C0 = STANCE.LS
  232. RS.C0 = STANCE.RS
  233. RJ.C0 = STANCE.RJ
  234. GRIP.C0 = STANCE.GRIP
  235.  
  236. local Down = false
  237.  
  238. Mouse.Button1Down:Connect(function()
  239.     Down = true
  240. end)
  241.  
  242. Mouse.Button1Up:Connect(function()
  243.     Down = false
  244. end)
  245.  
  246. math.randomseed(os.time())
  247.  
  248. local function Taunt()
  249.     local Taunts = {137542750, 130774824, 130776108, 679798995, 679798810}
  250.     local Sound = Instance.new("Sound", GUN)
  251.     local Id = Taunts[math.random(#Taunts)]
  252.     Sound.TimePosition = Id == 130776108 and 4.2 or 0
  253.     Sound.SoundId = "rbxassetid://" .. Id
  254.     Sound.Volume = 1
  255.     Sound.Ended:Connect(function()
  256.         Sound:Destroy()
  257.     end)
  258.     Sound:Play()
  259. end
  260.  
  261. Mouse.KeyDown:Connect(function(Key)
  262.     if Key == string.char(32) then
  263.         Taunt()
  264.     end
  265. end)
  266.  
  267.  
  268.  
  269. local function Shoot()
  270.     local Bullet = Instance.new("Part")
  271.     Bullet.Size = Vector3.new(0.3, 0.3, 0.7)
  272.     Bullet.Transparency = 1
  273.     Bullet.CanCollide = false
  274.    
  275.     local AntiGravity = Instance.new("BodyForce", Bullet)
  276.     AntiGravity.Force = Vector3.new(0, Bullet:GetMass() * workspace.Gravity, 0)
  277.    
  278.     local Start = (GUN.CFrame * CFrame.new(0.255, 0.251, 1.877)).p
  279.     Bullet.CFrame = CFrame.new(Start, Mouse.Hit.p)
  280.     Bullet.Velocity = Bullet.CFrame.lookVector * 300
  281.    
  282.     Bullet.Touched:Connect(function(Hit)
  283.         if Hit.Parent and Hit.Parent ~= Character and Hit.Parent:FindFirstChild("Humanoid") then
  284.             Hit.Parent.Humanoid:TakeDamage(5)
  285.             Bullet:Destroy()
  286.         end
  287.     end)
  288.    
  289.     Bullet.Parent = workspace
  290.     game.Debris:AddItem(Bullet, 3)
  291. end
  292.  
  293.  
  294. game:GetService("RunService"):BindToRenderStep("Invisible", Enum.RenderPriority.Character.Value - 1, function()
  295.     GUN.LocalTransparencyModifier = 0
  296.     FL.LocalTransparencyModifier = 0
  297.     LS.Part1.LocalTransparencyModifier = 0
  298.     RS.Part1.LocalTransparencyModifier = 0
  299. end)
  300.  
  301. local Heartbeat, Angle = game:GetService("RunService").Heartbeat
  302.  
  303. while Heartbeat:Wait() do
  304.     local Angle = tick() * 8
  305.        
  306.     -- Torso lean
  307.     local VelocityForTilt = RootPart.Velocity * Vector3.new(1, 0, 1) / 150
  308.     local VectorForTilt = RootPart.CFrame:vectorToObjectSpace(VelocityForTilt)
  309.     RJ.C0 = RJ.C0:Lerp(STANCE.RJ * CFrame.Angles(VectorForTilt.Z, VectorForTilt.X, -VectorForTilt.X), 0.1)
  310.  
  311.     -- Rotate to face camera
  312.     local RootPosition = RootPart.Position
  313.     local Direction = Mouse.Hit.p - RootPosition
  314.     Direction = Vector3.new(Direction.X, 0, Direction.Z).unit
  315.     local NewCFrame = CFrame.new(RootPosition, RootPosition + Direction) * CFrame.Angles(0, -0.02, 0)
  316.     RootPart.CFrame = RootPart.CFrame:Lerp(NewCFrame, 0.1)
  317.    
  318.     -- Neck Angle
  319.     local Hypotenuse = (Mouse.Hit.p - Head.Position).magnitude
  320.     local Opposite = Mouse.Hit.p.y - Head.Position.y
  321.     local Pitch = math.asin(Opposite / Hypotenuse)
  322.     local NewNeckCFrame = STANCE.NK * CFrame.Angles(Pitch + 0.2, 0, 0) * CFrame.new(0, 0.5, 0)
  323.     Neck.C0 = Neck.C0:Lerp(NewNeckCFrame, 0.1)
  324.    
  325.     -- Legs
  326.     local FlatVelocity = (Torso.Velocity * Vector3.new(1, 0, 1))
  327.     if FlatVelocity.magnitude < 2 then
  328.         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)
  329.         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)
  330.     else
  331.         local Look = (Torso.CFrame.lookVector * Vector3.new(1, 0, 1)).unit
  332.         local Move = FlatVelocity.unit
  333.         local OffAngle = (Look:Cross(Move).Y > 0 and 1 or -1) * math.acos(1 - (Look - Move).magnitude ^ 2 / 2)
  334.         OffAngle = math.max(-math.pi, math.min(math.pi, OffAngle))
  335.         LH.C0 = LH.C0:Lerp(CFrame.new(-0.5, 0, 0) * CFrame.Angles(0, OffAngle, 0)
  336.           * 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)
  337.           * CFrame.Angles(math.sin(-Angle) / 1.8 - 0.2, 0, 0), 0.2)
  338.         RH.C0 = RH.C0:Lerp(CFrame.new(0.5, 0, 0) * CFrame.Angles(0, OffAngle, 0)
  339.           * 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)
  340.           * CFrame.Angles(math.sin(Angle) / 1.8 - 0.2, 0, 0), 0.2)
  341.     end
  342.    
  343.     -- Shooting
  344.     if Down then
  345.         SN.Volume = SN.Volume + (1.5 - SN.Volume) * 0.3
  346.         FL.Transparency = FL.Transparency + (0.6 - FL.Transparency) * 0.2
  347.         FLW.C0 = FLW.C0 * CFrame.Angles(0, 0.2, 0)
  348.         Shoot()
  349.     else
  350.         SN.Volume = SN.Volume + (0 - SN.Volume) * 0.15
  351.         FL.Transparency = FL.Transparency + (1 - FL.Transparency) * 0.2
  352.     end
  353. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement