TheYoutuber_Pro

asdw

Jan 22nd, 2022 (edited)
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.88 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,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. local rp = RealPlayer
  6. script.Parent = rp.Character
  7.  
  8. --RemoteEvent for communicating
  9. local Event = Instance.new("RemoteEvent")
  10. Event.Name = "UserInput_Event"
  11.  
  12. --Fake event to make stuff like Mouse.KeyDown work
  13. local function fakeEvent()
  14. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  15. t.connect = t.Connect
  16. return t
  17. end
  18.  
  19. --Creating fake input objects with fake variables
  20. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  21. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  22. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  23. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  24. end}
  25. --Merged 2 functions into one by checking amount of arguments
  26. CAS.UnbindAction = CAS.BindAction
  27.  
  28. --This function will trigger the events that have been :Connect()'ed
  29. local function te(self,ev,...)
  30. local t = m[ev]
  31. if t and t._fakeEvent then
  32. for _,f in pairs(t.Functions) do
  33. f(...)
  34. end
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=rp then return end
  42. m.Target = io.Target
  43. m.Hit = io.Hit
  44. if not io.isMouse then
  45. local b = io.UserInputState == Enum.UserInputState.Begin
  46. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  47. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  48. end
  49. for _,t in pairs(CAS.Actions) do
  50. for _,k in pairs(t.Keys) do
  51. if k==io.KeyCode then
  52. t.Function(t.Name,io.UserInputState,io)
  53. end
  54. end
  55. end
  56. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  57. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  58. end
  59. end)
  60. Event.Parent = NLS([==[
  61. local Player = game:GetService("Players").LocalPlayer
  62. local Event = script:WaitForChild("UserInput_Event")
  63.  
  64. local Mouse = Player:GetMouse()
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local h,t
  75. --Give the server mouse data 30 times every second, but only if the values changed
  76. --If player is not moving their mouse, client won't fire events
  77. while wait(1/30) do
  78. if h~=Mouse.Hit or t~=Mouse.Target then
  79. h,t=Mouse.Hit,Mouse.Target
  80. Event:FireServer({isMouse=true,Target=t,Hit=h})
  81. end
  82. end]==],Player.Character)
  83.  
  84. ----Sandboxed game object that allows the usage of client-side methods and services
  85. --Real game object
  86. local _rg = game
  87.  
  88. --Metatable for fake service
  89. local fsmt = {
  90. __index = function(self,k)
  91. local s = rawget(self,"_RealService")
  92. if s then return s[k] end
  93. end,
  94. __newindex = function(self,k,v)
  95. local s = rawget(self,"_RealService")
  96. if s then s[k]=v end
  97. end,
  98. __call = function(self,...)
  99. local s = rawget(self,"_RealService")
  100. if s then return s(...) end
  101. end
  102. }
  103. local function FakeService(t,RealService)
  104. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  105. return setmetatable(t,fsmt)
  106. end
  107.  
  108. --Fake game object
  109. local g = {
  110. GetService = function(self,s)
  111. return self[s]
  112. end,
  113. Players = FakeService({
  114. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  115. },"Players"),
  116. UserInputService = FakeService(UIS,"UserInputService"),
  117. ContextActionService = FakeService(CAS,"ContextActionService"),
  118. }
  119. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  120. g.service = g.GetService
  121.  
  122. g.RunService = FakeService({
  123. RenderStepped = _rg:GetService("RunService").Heartbeat,
  124. BindToRenderStep = function(self,name,_,fun)
  125. self._btrs[name] = self.Heartbeat:Connect(fun)
  126. end,
  127. UnbindFromRenderStep = function(self,name)
  128. self._btrs[name]:Disconnect()
  129. end,
  130. },"RunService")
  131.  
  132. setmetatable(g,{
  133. __index=function(self,s)
  134. return _rg:GetService(s) or typeof(_rg[s])=="function"
  135. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  136. end,
  137. __newindex = fsmt.__newindex,
  138. __call = fsmt.__call
  139. })
  140. --Changing owner to fake player object to support owner:GetMouse()
  141. game,owner = g,g.Players.LocalPlayer
  142. end
  143.  
  144. Tool0 = Instance.new("Tool")
  145. Tool0.Name = "polish kid"
  146. Tool0.ToolTip = "brody foxx says this funny line"
  147. Tool0.Parent = owner.Backpack
  148. Tool0.RequiresHandle = false
  149. local onion = Instance.new("Sound")
  150. onion.Parent = Head
  151. onion.SoundId = 'rbxassetid://5728444220'
  152. onion.Volume = 1
  153. local theme = Instance.new("Sound")
  154. theme.Parent = Head
  155. theme.SoundId = 'rbxassetid://837030083'
  156. theme.Volume = 1
  157. local fat = Instance.new("Sound")
  158. fat.Parent = Head
  159. fat.SoundId = 'rbxassetid://5728444004'
  160. fat.Volume = 1
  161. Tool0.Activated:Connect(function()
  162. if m.Target.Parent:FindFirstChildOfClass("Humanoid") then
  163. local animation = Instance.new("Animation")
  164. animation.AnimationId = "http://www.roblox.com/asset/?id=128853357"
  165. local animationTrack = Humanoid:LoadAnimation(animation)
  166. animationTrack:Play()
  167. animationTrack:AdjustSpeed(0.8)
  168. theme.Volume = 1
  169. local insultm = math.random(1, 2)
  170. if insultm == 1 then
  171. onion:Play()
  172. theme:Play()
  173. local heh = Instance.new("Part")
  174. heh.Parent = m.Target.Parent.Torso
  175. heh.CanCollide = false
  176. heh.Size = Vector3.new(2,2,1)
  177. heh.Transparency = 1
  178. local weld = Instance.new("Weld")
  179. weld.Part0 = heh
  180. weld.Part1 = m.Target.Parent.Torso
  181. weld.Parent = heh
  182. weld.C0 = CFrame.new()
  183. game.Chat.BubbleChatEnabled = true
  184. local ChatService = game:GetService("Chat")
  185. ChatService:Chat(owner.Character.Head, "yo mama so ugly, she made an onion cry!")
  186. local crit = Instance.new("Sound")
  187. crit.Parent = heh.Parent.Parent.Head
  188. crit.SoundId = 'rbxassetid://3244487317'
  189. crit.Volume = 1
  190. wait(3.9)
  191. local bv = Instance.new("BodyVelocity")
  192. bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  193. bv.Velocity = heh.Parent.Parent.Head.CFrame.lookVector * -75
  194. bv.Parent = heh.Parent.Parent.Head
  195. heh.Parent.Parent:FindFirstChildOfClass("Humanoid").Sit = true
  196. wait(0.05)
  197. bv:Destroy()
  198. heh.Parent.Parent.Humanoid:TakeDamage(35)
  199. crit:Play()
  200. wait(.2)
  201. heh:Destroy()
  202. end
  203. if insultm == 2 then
  204. fat:Play()
  205. theme:Play()
  206. game.Chat.BubbleChatEnabled = true
  207. local ChatService = game:GetService("Chat")
  208. ChatService:Chat(owner.Character.Head, "yo mama so fat...she doesn't need the internet, she was already worldwide!")
  209. local heh = Instance.new("Part")
  210. heh.Parent = m.Target.Parent.Torso
  211. heh.CanCollide = false
  212. heh.Size = Vector3.new(2,2,1)
  213. heh.Transparency = 1
  214. local weld = Instance.new("Weld")
  215. weld.Part0 = heh
  216. weld.Part1 = m.Target.Parent.Torso
  217. weld.Parent = heh
  218. weld.C0 = CFrame.new()
  219. local crit = Instance.new("Sound")
  220. crit.Parent = heh.Parent.Parent.Head
  221. crit.SoundId = 'rbxassetid://4634841343'
  222. crit.Volume = 1
  223. wait(8)
  224. local bv = Instance.new("BodyVelocity")
  225. bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  226. bv.Velocity = heh.Parent.Parent.Head.CFrame.lookVector * -50
  227. bv.Parent = heh.Parent.Parent.Head
  228. heh.Parent.Parent:FindFirstChildOfClass("Humanoid").Sit = true
  229. wait(.05)
  230. bv:Destroy()
  231. heh.Parent.Parent.Humanoid:TakeDamage(35)
  232. crit:Play()
  233. wait(.2)
  234. heh:Destroy()
  235. end
  236. end
  237. end)
  238. fat.Ended:Connect(function()
  239. theme.Volume = 0.8
  240. wait(.1)
  241. theme.Volume = 0.6
  242. wait(.1)
  243. theme.Volume = 0.4
  244. wait(.1)
  245. theme.Volume = 0.2
  246. wait(.1)
  247. theme:Stop()
  248. end)
  249. onion.Ended:Connect(function()
  250. theme.Volume = 0.8
  251. wait(.1)
  252. theme.Volume = 0.6
  253. wait(.1)
  254. theme.Volume = 0.4
  255. wait(.1)
  256. theme.Volume = 0.2
  257. wait(.1)
  258. theme:Stop()
  259. end)
  260.  
  261. game:GetService("RunService").RenderStepped:Connect(function()
  262. Aim.CFrame = Character.Head.CFrame
  263. Aim.CFrame = CFrame.new(Aim.Position, m.Hit.p)
  264. if Holding == true then
  265. for i = 0,1,.01 do
  266. wait(0.01)
  267. if Target ~= nil then
  268. Target.CFrame = Target.CFrame:Lerp(Aim.CFrame * CFrame.new(0, 0, -meter), i)
  269. end
  270. end
  271. end
  272. end)
Add Comment
Please, Sign In to add comment