Advertisement
DarkScriptZEditors

Untitled

Dec 29th, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.13 KB | None | 0 0
  1.  
  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,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code by Mokiros")
  7. local rp = RealPlayer
  8. script.Parent = rp.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent then
  34. for _,f in pairs(t.Functions) do
  35. f(...)
  36. end
  37. end
  38. end
  39. m.TrigEvent = te
  40. UIS.TrigEvent = te
  41.  
  42. Event.OnServerEvent:Connect(function(plr,io)
  43. if plr~=rp then return end
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. if not io.isMouse then
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  52. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  53. end
  54. for _,t in pairs(CAS.Actions) do
  55. for _,k in pairs(t.Keys) do
  56. if k==io.KeyCode then
  57. t.Function(t.Name,io.UserInputState,io)
  58. end
  59. end
  60. end
  61. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  62. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  63. end
  64. end)
  65. Event.Parent = NLS([==[
  66. local Player = game:GetService("Players").LocalPlayer
  67. local Event = script:WaitForChild("UserInput_Event")
  68. local Mouse = Player:GetMouse()
  69. local UIS = game:GetService("UserInputService")
  70. local input = function(io,a)
  71. if a then return end
  72. --Since InputObject is a client-side instance, we create and pass table instead
  73. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  74. end
  75. UIS.InputBegan:Connect(input)
  76. UIS.InputEnded:Connect(input)
  77. local h,t
  78. --Give the server mouse data 30 times every second, but only if the values changed
  79. --If player is not moving their mouse, client won't fire events
  80. while wait(1/30) do
  81. if h~=Mouse.Hit or t~=Mouse.Target then
  82. h,t=Mouse.Hit,Mouse.Target
  83. Event:FireServer({isMouse=true,Target=t,Hit=h})
  84. end
  85. end]==],Player.Character)
  86.  
  87. ----Sandboxed game object that allows the usage of client-side methods and services
  88. --Real game object
  89. local _rg = game
  90.  
  91. --Metatable for fake service
  92. local fsmt = {
  93. __index = function(self,k)
  94. local s = rawget(self,"_RealService")
  95. if s then
  96. return typeof(s[k])=="function"
  97. and function(_,...)return s[k](s,...)end or s[k]
  98. end
  99. end,
  100. __newindex = function(self,k,v)
  101. local s = rawget(self,"_RealService")
  102. if s then s[k]=v end
  103. end
  104. }
  105. local function FakeService(t,RealService)
  106. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  107. return setmetatable(t,fsmt)
  108. end
  109.  
  110. --Fake game object
  111. local g = {
  112. GetService = function(self,s)
  113. return rawget(self,s) or _rg:GetService(s)
  114. end,
  115. Players = FakeService({
  116. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  117. },"Players"),
  118. UserInputService = FakeService(UIS,"UserInputService"),
  119. ContextActionService = FakeService(CAS,"ContextActionService"),
  120. RunService = FakeService({
  121. _btrs = {},
  122. RenderStepped = _rg:GetService("RunService").Heartbeat,
  123. BindToRenderStep = function(self,name,_,fun)
  124. self._btrs[name] = self.Heartbeat:Connect(fun)
  125. end,
  126. UnbindFromRenderStep = function(self,name)
  127. self._btrs[name]:Disconnect()
  128. end,
  129. },"RunService")
  130. }
  131. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  132. g.service = g.GetService
  133. FakeService(g,game)
  134. --Changing owner to fake player object to support owner:GetMouse()
  135. game,owner = g,g.Players.LocalPlayer
  136. endplayer=game:GetService'Players'.LocalPlayer
  137.  
  138.  
  139. nqqas={"VersedBK", "ThuggLyfe", "grubsteak", "Pkamara", "TheDarkRevenant", "TheScripterGeek", "clv2", "ElitePug", "jillmiles1", "jonesj627", player.Name}--
  140. aggrorange=20;
  141.  
  142. messages={
  143. [3]="yo get off our turf, %p";
  144. [6]="im warning u";
  145. [8]="3...";
  146. [9]="2...";
  147. [10]="1..";
  148. [11]="FIRE";
  149. }
  150.  
  151.  
  152. t=Instance.new("Tool", player.Backpack)
  153. t.Name="LunchThug"
  154.  
  155. Instance.new("Part", t).Name="Handle"
  156. t.Equipped:connect(function()
  157.  
  158. model=Instance.new("Model", workspace)
  159. model.Name="LunchaThug"
  160.  
  161. box=Instance.new("Part", model)
  162. box.FormFactor=Enum.FormFactor.Custom
  163. box.Size=Vector3.new(4, 4, 2)
  164. box.Name="Head"
  165. dc=Instance.new("Decal", box)
  166. dc.Texture="http://www.roblox.com/asset/?id=265177579"
  167. dc.Face=Enum.NormalId.Front
  168. box.BrickColor=BrickColor.new("Bright yellow")
  169. box.Anchored=false
  170. box.TopSurface="Smooth"
  171. box.BottomSurface="Smooth"
  172.  
  173. hum=Instance.new("Humanoid", model)
  174. hum.Health=0
  175. hum.MaxHealth=0
  176.  
  177. gun=Instance.new("Part", model)
  178. gun.FormFactor=Enum.FormFactor.Custom
  179. gun.Size=Vector3.new(.4, 1, 1.2)
  180. gun.Name="gun"
  181. local shoot=Instance.new("Sound", gun)
  182. shoot.SoundId="rbxassetid://180955656"
  183. gunmesh=Instance.new("SpecialMesh", gun)
  184. gunmesh.MeshType=Enum.MeshType.FileMesh
  185. gunmesh.MeshId="rbxassetid://4372594"
  186. gunmesh.TextureId="rbxassetid://0"
  187. gunmesh.VertexColor=Vector3.new(0, 0, 0)
  188. w=Instance.new("Weld", box)
  189. w.Part0=box
  190. w.Part1=gun
  191. w.C0=CFrame.new(2.20000076, 0.700000048, -1, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  192.  
  193. local gyro=Instance.new("BodyGyro", box)
  194. gyro.maxTorque=Vector3.new(math.huge, math.huge, 0)
  195. gyro.P=10000
  196. local startTime=nil
  197. local oldBestPlaya
  198. local currentmsg=""
  199. model:MoveTo(player.Character.Torso.Position-Vector3.new(0, 1, 5))
  200. math.randomseed(tick())
  201. coroutine.wrap(function()
  202. while box do
  203. wait()
  204. local bestPlaya=nil
  205. local bestDist=math.huge
  206. if not oldBestPlaya or oldBestPlaya:DistanceFromCharacter(box.Position)>aggrorange then
  207. for _, p in pairs(game:GetService'Players':GetPlayers()) do
  208. if p.Character and p.Character:FindFirstChild("Torso") and not p.Character:FindFirstChild("greeted") and p:DistanceFromCharacter(box.Position)<=aggrorange and p:DistanceFromCharacter(box.Position)<bestDist then
  209. bestPlaya=p
  210. bestDist=p:DistanceFromCharacter(box.Position)
  211. end
  212. end
  213. if bestPlaya then
  214. oldBestPlaya=bestPlaya
  215. startTime=tick()
  216. end
  217. end
  218. local p=oldBestPlaya
  219.  
  220.  
  221. if p then
  222. notanqqa=true
  223. for _, playa in pairs(nqqas) do
  224. if p.Name:lower()==playa:lower() then
  225. notanqqa=false
  226. end
  227. end
  228.  
  229. --print(p.Name)
  230.  
  231. gyro.cframe=CFrame.new(box.CFrame.p, p.Character:FindFirstChild("Head") and p.Character.Head.CFrame.p or p.Character:GetModelCFrame())
  232. if notanqqa then
  233. local msg=""
  234. local mtime=0
  235. for i, v in pairs(messages) do
  236. if i>=mtime and tick()-startTime>=i then
  237. msg=v
  238. mtime=i
  239. end
  240. end
  241. if currentmsg~=msg then
  242. currentmsg=msg
  243. if msg=="FIRE" then
  244. for i=1, 12 do
  245. shoot:Play()
  246. if p.Character and p.Character:FindFirstChild("Humanoid") then
  247. p.Character:FindFirstChild("Humanoid").Health=p.Character:FindFirstChild("Humanoid").Health-(p.Character:FindFirstChild("Humanoid").MaxHealth*(math.random(1, 10)/20))
  248. end
  249. if p.Character and p.Character:FindFirstChild("Humanoid") and p.Character:FindFirstChild("Humanoid").Health<=0 then
  250. wait(3)
  251. gyro.cframe=CFrame.new(0, 0, 0)
  252. wait(2)
  253. game:GetService("Chat"):Chat(box, ("any1 else???"):gsub("%%p", p.Name))
  254. wait(3)
  255. game:GetService("Chat"):Chat(box, ("dats rite"):gsub("%%p", p.Name))
  256. wait(5)
  257. oldBestPlaya=nil
  258. break
  259.  
  260. end
  261. wait(math.random(1, 10)/8)
  262. end
  263. elseif msg~="" then
  264. game:GetService("Chat"):Chat(box, msg:gsub("%%p", p.Name))
  265. end
  266. end
  267. else
  268. wait(2)
  269. game:GetService("Chat"):Chat(box, ("yo wassup cuz"):gsub("%%p", p.Name))
  270. local gr=Instance.new("IntValue", p.Character)
  271. gr.Name="greeted"
  272. game:GetService("Debris"):AddItem(gr, 60);
  273. oldBestPlaya=nil
  274. wait(5)
  275. gyro.cframe=CFrame.new(0, 0, 0)
  276. end
  277. end
  278. end
  279. end)()
  280. if player.Character and player.Character:FindFirstChild("Humanoid") then
  281. player.Character.Humanoid:UnequipTools();
  282. wait()
  283. t:Destroy()
  284. end
  285. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement