Infintyboy

tf_bot_add ; god ; noclip ; freeze

Sep 8th, 2018
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.41 KB | None | 0 0
  1. --TODO: add comments or something idk
  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 = owner
  4. local Mouse,mouse,UserInputService,ContextActionService
  5. do
  6.     script.Parent = Player.Character
  7.     local CAS = {Actions={}}
  8.     local Event = Instance.new("RemoteEvent")
  9.     Event.Name = "UserInput_Event"
  10.     Event.Parent = Player.Character
  11.     local fakeEvent = function()
  12.         local t = {_fakeEvent=true}
  13.         t.Connect = function(self,f)self.Function=f end
  14.         t.connect = t.Connect
  15.         return t
  16.     end
  17.     local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  18.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  19.     function CAS:BindAction(name,fun,touch,...)
  20.         CAS.Actions[name] = {Name=name,Function=fun,Keys={...}}
  21.     end
  22.     function CAS:UnbindAction(name)
  23.         CAS.Actions[name] = nil
  24.     end
  25.     local function te(self,ev,...)
  26.         local t = m[ev]
  27.         if t and t._fakeEvent and t.Function then
  28.             t.Function(...)
  29.         end
  30.     end
  31.     m.TrigEvent = te
  32.     UIS.TrigEvent = te
  33.     Event.OnServerEvent:Connect(function(plr,io)
  34.         if plr~=Player then return end
  35.         if io.isMouse then
  36.             m.Target = io.Target
  37.             m.Hit = io.Hit
  38.         elseif io.UserInputType == Enum.UserInputType.MouseButton1 then
  39.             if io.UserInputState == Enum.UserInputState.Begin then
  40.                 m:TrigEvent("Button1Down")
  41.             else
  42.                 m:TrigEvent("Button1Up")
  43.             end
  44.         else
  45.             for n,t in pairs(CAS.Actions) do
  46.                 for _,k in pairs(t.Keys) do
  47.                     if k==io.KeyCode then
  48.                         t.Function(t.Name,io.UserInputState,io)
  49.                     end
  50.                 end
  51.             end
  52.             if io.UserInputState == Enum.UserInputState.Begin then
  53.                 m:TrigEvent("KeyDown",io.KeyCode.Name:lower())
  54.                 UIS:TrigEvent("InputBegan",io,false)
  55.             else
  56.                 m:TrigEvent("KeyUp",io.KeyCode.Name:lower())
  57.                 UIS:TrigEvent("InputEnded",io,false)
  58.             end
  59.         end
  60.     end)
  61.     NLS([==[
  62.     local Player = game:GetService("Players").LocalPlayer
  63.    
  64.     local Char = Player.Character
  65.     local Event = Char:WaitForChild("UserInput_Event")
  66.    
  67.     local UIS = game:GetService("UserInputService")
  68.    
  69.     local input = function(io,a)
  70.         if a then return end
  71.         local io = {KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}
  72.         Event:FireServer(io)
  73.     end
  74.     UIS.InputBegan:Connect(input)
  75.     UIS.InputEnded:Connect(input)
  76.     local Changed = false
  77.     local Mouse = Player:GetMouse()
  78.     local mouse = Player:GetMouse()
  79.     local h,t = Mouse.Hit,Mouse.Target
  80.     while wait(1/30) do
  81.         if h~=Mouse.Hit or t~=Mouse.Target then
  82.             Event:FireServer({isMouse=true,Target=Mouse.Target,Hit=Mouse.Hit})
  83.             h,t=Mouse.Hit,Mouse.Target
  84.         end
  85.     end
  86.     ]==],Player.Character)
  87.     Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  88. end
  89.  
  90.  
  91. Player = owner
  92. PlayerGui = Player.PlayerGui
  93. Cam = workspace.CurrentCamera
  94. Backpack = Player.Backpack
  95. local plr = owner
  96. local char = plr.Character
  97. local hum = char.Humanoid
  98. local hed = char.Head
  99. local root = char.HumanoidRootPart
  100. local rootj = root.RootJoint
  101. local tors = char.Torso
  102. local ra = char["Right Arm"]
  103. local la = char["Left Arm"]
  104. local rl = char["Right Leg"]
  105. local ll = char["Left Leg"]
  106. local neck = tors["Neck"]
  107. local mouse = plr:GetMouse()
  108. local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  109. local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
  110. local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
  111. local maincolor = BrickColor.new("Institutional white")
  112. cam = game.Workspace.CurrentCamera
  113. CF = CFrame.new
  114. angles = CFrame.Angles
  115. attack = false
  116. Euler = CFrame.fromEulerAnglesXYZ
  117. Rad = math.rad
  118. IT = Instance.new
  119. BrickC = BrickColor.new
  120. Cos = math.cos
  121. Acos = math.acos
  122. Sin = math.sin
  123. Asin = math.asin
  124. Abs = math.abs
  125. Mrandom = math.random
  126. Floor = math.floor
  127. Character = Player.Character
  128. local Char = Player.Character
  129. Humanoid = Character.Humanoid
  130. RootPart = Character["HumanoidRootPart"]
  131. Torso = Character["Torso"]
  132. Head = Character["Head"]
  133. RightArm = Character["Right Arm"]
  134. LeftArm = Character["Left Arm"]
  135. RightLeg = Character["Right Leg"]
  136. LeftLeg = Character["Left Leg"]
  137. RootJoint = RootPart["RootJoint"]
  138. Neck = Torso["Neck"]
  139. RightShoulder = Torso["Right Shoulder"]
  140. LeftShoulder = Torso["Left Shoulder"]
  141. RightHip = Torso["Right Hip"]
  142. LeftHip = Torso["Left Hip"]
  143.  
  144. IT = Instance.new
  145. CF = CFrame.new
  146. VT = Vector3.new
  147. RAD = math.rad
  148. C3 = Color3.new
  149. UD2 = UDim2.new
  150. BRICKC = BrickColor.new
  151. ANGLES = CFrame.Angles
  152. EULER = CFrame.fromEulerAnglesXYZ
  153. COS = math.cos
  154. ACOS = math.acos
  155. SIN = math.sin
  156. ASIN = math.asin
  157. ABS = math.abs
  158. MRANDOM = math.random
  159. FLOOR = math.floor
  160.  
  161. --//=================================\\
  162. --||          CUSTOMIZATION
  163. --\\=================================//
  164.  
  165. Player_Size = 1 --Size of the player.
  166. Animation_Speed = 3
  167. Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
  168.  
  169. local Speed = 16
  170. local Effects2 = {}
  171.  
  172. --//=================================\\
  173. --||          USEFUL VALUES
  174. --\\=================================//
  175.  
  176. local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  177. local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  178. local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0))
  179. local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0))
  180. local CHANGEDEFENSE = 0
  181. local CHANGEDAMAGE = 0
  182. local CHANGEMOVEMENT = 0
  183. local ANIM = "Idle"
  184. local ATTACK = false
  185. local EQUIPPED = false
  186. local HOLD = false
  187. local COMBO = 1
  188. local Rooted = false
  189. local SINE = 0
  190. local KEYHOLD = false
  191. local CHANGE = 2 / Animation_Speed
  192. local WALKINGANIM = false
  193. local WALK = 0
  194. local VALUE1 = false
  195. local VALUE2 = false
  196. local ROBLOXIDLEANIMATION = IT("Animation")
  197. ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation"
  198. ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  199. --ROBLOXIDLEANIMATION.Parent = Humanoid
  200. local WEAPONGUI = IT("ScreenGui", PlayerGui)
  201. WEAPONGUI.Name = "Weapon GUI"
  202. local Effects = IT("Folder", Character)
  203. Effects.Name = "Effects"
  204. local ANIMATOR = Humanoid.Animator
  205. local ANIMATE = Character.Animate
  206. local HITPLAYERSOUNDS = {--[["199149137", "199149186", "199149221", "199149235", "199149269", "199149297"--]]"263032172", "263032182", "263032200", "263032221", "263032252", "263033191"}
  207. local HITARMORSOUNDS = {"199149321", "199149338", "199149367", "199149409", "199149452"}
  208. local HITWEAPONSOUNDS = {"199148971", "199149025", "199149072", "199149109", "199149119"}
  209. local HITBLOCKSOUNDS = {"199148933", "199148947"}
  210. local UNANCHOR = true
  211.  
  212. local SKILLTEXTCOLOR = C3(0.05,0.05,0.15)
  213.  
  214. --//=================================\\
  215. --\\=================================//
  216.  
  217. local FF = IT("ForceField",Character)
  218. FF.Visible = false
  219. Speed = 16
  220.  
  221. function refit()
  222.     RootJoint.Parent = RootPart
  223.     Neck.Parent = Torso
  224.     RightShoulder.Parent = Torso
  225.     LeftShoulder.Parent = Torso
  226.     RightHip.Parent = Torso
  227.     LeftHip.Parent = Torso
  228.     RootPart.Parent = Character
  229.     LeftArm.Parent = Character
  230.     RightArm.Parent = Character
  231.     RightLeg.Parent = Character
  232.     LeftLeg.Parent = Character
  233.     Torso.Parent = Character
  234.     Head.Parent = Character
  235. end
  236.  
  237. function CreateSound(ID, PARENT, VOLUME, PITCH)
  238.     local NEWSOUND = nil
  239.     coroutine.resume(coroutine.create(function()
  240.         NEWSOUND = IT("Sound", PARENT)
  241.         NEWSOUND.Volume = VOLUME
  242.         NEWSOUND.Pitch = PITCH
  243.         NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
  244.         Swait()
  245.         NEWSOUND:play()
  246.         game:GetService("Debris"):AddItem(NEWSOUND, 10)
  247.     end))
  248.     return NEWSOUND
  249. end
  250.  
  251. Humanoid.Died:connect(function()
  252.     Humanoid.Parent = nil
  253.     Humanoid.MaxHealth = "inf"
  254.     Humanoid.Health = "inf"
  255.     refit()
  256.     Humanoid.Parent = Character
  257. end)
  258.  
  259. while true do
  260. wait()
  261. FF.Parent = Character
  262.     local IDLEANIMATION = Humanoid:LoadAnimation(ROBLOXIDLEANIMATION)
  263.     IDLEANIMATION:Play()
  264. Humanoid.MaxHealth = "inf"
  265. Humanoid.WalkSpeed = Speed
  266. Humanoid.Health = "inf"
  267. refit()
  268. char.Parent = game.workspace
  269.     for _, c in pairs(game.Players:GetChildren()) do
  270.         if c.Character ~= nil then
  271.             if c.Character.Parent ~= workspace and c.Character.Parent ~= nil then
  272.                 c.Character:BreakJoints()
  273.             end
  274.         end
  275.     end
  276. end
Add Comment
Please, Sign In to add comment