Advertisement
zephpsian

Untitled

Feb 2nd, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.46 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 = Player.Character
  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.  
  88.  
  89. local Player = owner
  90. local Character = Player.Character
  91. local Humanoid = Character.Humanoid
  92.  
  93.  
  94. local loaded = false
  95. local LeftArm = Character["Left Arm"]
  96. local RightArm = Character["Right Arm"]
  97. local LeftLeg = Character["Left Leg"]
  98. local RightLeg = Character["Right Leg"]
  99. local Head = Character.Head
  100. local Torso = Character.Torso
  101. local Camera = game.Workspace.CurrentCamera
  102. local RootPart = Character.HumanoidRootPart
  103. local RootJoint = RootPart.RootJoint
  104. local attack = false
  105. local Anim = 'Idle'
  106. local attacktype = 1
  107. local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  108. local velocity = RootPart.Velocity.y
  109. local sine = 0
  110. local change = 1
  111. local oml = false
  112. local Equipped = false
  113. local hide = false
  114. local Gender = 1 --Triggered
  115. local Create = LoadLibrary("RbxUtility").Create
  116. Character.Humanoid.MaxHealth = math.huge
  117. Character.Humanoid.Health = math.huge
  118.  
  119. local toggleTag = true
  120. local bilguit = Instance.new("BillboardGui", hed)
  121. bilguit.Adornee = nil
  122. bilguit.Name = "ModeName"
  123. bilguit.Size = UDim2.new(4, 0, 1.2, 0)
  124. bilguit.StudsOffset = Vector3.new(-8, 8/1.5, 0)
  125. local modet = Instance.new("TextLabel", bilguit)
  126. modet.Size = UDim2.new(10/2, 0, 7/2, 0)
  127. modet.FontSize = "Size8"
  128. modet.TextScaled = true
  129. modet.TextTransparency = 0
  130. modet.BackgroundTransparency = 1
  131. modet.TextTransparency = 0
  132. modet.TextStrokeTransparency = 0
  133. modet.Font = "Antique"
  134. modet.TextStrokeColor3 = Color3.new(1,0,0)
  135. modet.TextColor3 = Color3.new(0.25,0,0)
  136. modet.Text = "Do not disturb G_osty is editing or scripting a script"
  137.  
  138. New = function(Object, Parent, Name, Data)
  139. local Object = Instance.new(Object)
  140. for Index, Value in pairs(Data or {}) do
  141. Object[Index] = Value
  142. end
  143. Object.Parent = Parent
  144. Object.Name = Name
  145. return Object
  146. end
  147.  
  148. New = function(Object, Parent, Name, Data)
  149. local Object = Instance.new(Object)
  150. for Index, Value in pairs(Data or {}) do
  151. Object[Index] = Value
  152. end
  153. Object.Parent = Parent
  154. Object.Name = Name
  155. return Object
  156. end
  157.  
  158. stick = New("Model",Torso,"stick",{})
  159.  
  160. Handle = New("Part",stick,"Handle",{BrickColor = BrickColor.new("Institutional white"),Material = Enum.Material.SmoothPlastic,Transparency = 1,Transparency = 1,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.200000003),CFrame = CFrame.new(-52.3997879, -1.08457458, -63.8579559, -1, -5.30103321e-08, 1.31363009e-07, 5.19570165e-09, -0.940442502, -0.339954078, 1.41560349e-07, -0.339954227, 0.940441906),BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.972549, 0.972549, 0.972549),})
  161.  
  162. moter = New("Motor",Handle,"mot",{Part0 = Handle,Part1 = Torso,})
  163.  
  164. local newMotor = function(part0, part1, c0, c1)
  165. local w = Create('Motor'){
  166. Parent = part0,
  167. Part0 = part0,
  168. Part1 = part1,
  169. C0 = c0,
  170. C1 = c1,
  171. }
  172. return w
  173. end
  174.  
  175. function clerp(a,b,t)
  176. local qa = {QuaternionFromCFrame(a)}
  177. local qb = {QuaternionFromCFrame(b)}
  178. local ax, ay, az = a.x, a.y, a.z
  179. local bx, by, bz = b.x, b.y, b.z
  180. local _t = 1-t
  181. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  182. end
  183.  
  184. function QuaternionFromCFrame(cf)
  185. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  186. local trace = m00 + m11 + m22
  187. if trace > 0 then
  188. local s = math.sqrt(1 + trace)
  189. local recip = 0.5/s
  190. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  191. else
  192. local i = 0
  193. if m11 > m00 then
  194. i = 1
  195. end
  196.  
  197. local RW = newMotor(Torso, RightArm, CFrame.new(1.5, 0, 0), CFrame.new(0, 0, 0))
  198. local LW = newMotor(Torso, LeftArm, CFrame.new(-1.5, 0, 0), CFrame.new(0, 0, 0))
  199. local RH = newMotor(Torso, RightLeg, CFrame.new(.5, -2, 0), CFrame.new(0, 0, 0))
  200. local LH = newMotor(Torso, LeftLeg, CFrame.new(-.5, -2, 0), CFrame.new(0, 0, 0))
  201.  
  202. local rarmc1 = RW.C1
  203. local larmc1 = LW.C1
  204. local rlegc1 = RH.C1
  205. local llegc1 = LH.C1
  206.  
  207. local resetc1 = false
  208.  
  209. function PlayAnimationFromTable(table, speed, bool)
  210. RootJoint.C0 = clerp(RootJoint.C0, table[1], speed)
  211. Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed)
  212. RW.C0 = clerp(RW.C0, table[3], speed)
  213. LW.C0 = clerp(LW.C0, table[4], speed)
  214. RH.C0 = clerp(RH.C0, table[5], speed)
  215. LH.C0 = clerp(LH.C0, table[6], speed)
  216. if bool == true then
  217. if resetc1 == false then
  218. resetc1 = true
  219. RootJoint.C1 = RootJoint.C1
  220. Torso.Neck.C1 = Torso.Neck.C1
  221. RW.C1 = rarmc1
  222. LW.C1 = larmc1
  223. RH.C1 = rlegc1
  224. LH.C1 = llegc1
  225. end
  226. end
  227. end
  228.  
  229.  
  230. ArtificialHB = Create("BindableEvent", script){
  231. Parent = script,
  232. Name = "Heartbeat",
  233. }
  234.  
  235.  
  236. function swait(num)
  237. if num == 0 or num == nil then
  238. ArtificialHB.Event:wait()
  239. else
  240. for i = 0, num do
  241. ArtificialHB.Event:wait()
  242. end
  243. end
  244. end
  245.  
  246. function RemoveOutlines(part)
  247. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  248. end
  249.  
  250. loaded = true
  251.  
  252. function Sit2()
  253. attack = true
  254. Humanoid.WalkSpeed = 0
  255. Humanoid.JumpPower = 0
  256. sit = true
  257. repeat
  258. swait()
  259. PlayAnimationFromTable({
  260. CFrame.new(-0.0790518373, -1.28211284, -0.364974797, 1, -9.19981517e-07, 1.01839339e-06, 4.712426e-07, 0.927110493, 0.374788225, -1.28896136e-06, -0.374788225, 0.927110493) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  261. CFrame.new(0.0790522769, 1.41239452, 0.0392460488, 1, 9.46696446e-07, -9.93475055e-07, -9.19947979e-07, 0.999646187, 0.0265871882, 1.01829437e-06, -0.0265878141, 0.999649346) * CFrame.new(0, 0, 0 - .05 * math.cos(sine/40)) * CFrame.Angles(math.rad(0 - 5 * math.cos(sine/40)), 0, 0),
  262. CFrame.new(1.09309757, 0.19830294, -0.861271143, 0.76847899, 0.336144269, 0.544469535, 0.239813626, 0.637579441, -0.732107878, -0.593236446, 0.693180799, 0.409354448) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  263. CFrame.new(-0.881041527, 0.313548326, -0.857817411, 0.679015219, -0.402120054, -0.614196837, -0.27513656, 0.636264682, -0.720740676, 0.68061614, 0.658381879, 0.321395457) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  264. CFrame.new(0.735003531, -0.977018833, -1.17779481, 0.989697278, -0.143176422, -4.26077889e-07, -0.0562922768, -0.389113575, -0.919468403, 0.131646067, 0.909995139, -0.393164426) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  265. CFrame.new(-0.620305955, -0.990102291, -1.11360347, 0.980935276, 0.194335416, -1.13580725e-07, 0.0785024986, -0.396252751, -0.914779246, -0.177774101, 0.897339165, -0.403954059) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0),
  266. }, .1, false)
  267. moter.C0 = clerp(moter.C0, CFrame.new(0.023572728, -0.897642493, -0.694501638, -0.998318791, -0.0538648441, 0.0214428138, -4.82425094e-07, -0.36984843, -0.92909205, 0.0579760745, -0.927529037, 0.369226247) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), 0.3)
  268. until attack == true
  269. end
  270. if loaded == true then
  271. Sit2()
  272. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement