Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code by Mokiros")
- local rp = RealPlayer
- script.Parent = rp.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return m:TrigEvent(b and "Button2Down" or "Button2Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local Mouse = Player:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return rawget(self,s) or _rg:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- FakeService(g,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- endplayer=game:GetService'Players'.LocalPlayer
- nqqas={"VersedBK", "ThuggLyfe", "grubsteak", "Pkamara", "TheDarkRevenant", "TheScripterGeek", "clv2", "ElitePug", "jillmiles1", "jonesj627", player.Name}--
- aggrorange=20;
- messages={
- [3]="yo get off our turf, %p";
- [6]="im warning u";
- [8]="3...";
- [9]="2...";
- [10]="1..";
- [11]="FIRE";
- }
- t=Instance.new("Tool", player.Backpack)
- t.Name="LunchThug"
- Instance.new("Part", t).Name="Handle"
- t.Equipped:connect(function()
- model=Instance.new("Model", workspace)
- model.Name="LunchaThug"
- box=Instance.new("Part", model)
- box.FormFactor=Enum.FormFactor.Custom
- box.Size=Vector3.new(4, 4, 2)
- box.Name="Head"
- dc=Instance.new("Decal", box)
- dc.Texture="http://www.roblox.com/asset/?id=265177579"
- dc.Face=Enum.NormalId.Front
- box.BrickColor=BrickColor.new("Bright yellow")
- box.Anchored=false
- box.TopSurface="Smooth"
- box.BottomSurface="Smooth"
- hum=Instance.new("Humanoid", model)
- hum.Health=0
- hum.MaxHealth=0
- gun=Instance.new("Part", model)
- gun.FormFactor=Enum.FormFactor.Custom
- gun.Size=Vector3.new(.4, 1, 1.2)
- gun.Name="gun"
- local shoot=Instance.new("Sound", gun)
- shoot.SoundId="rbxassetid://180955656"
- gunmesh=Instance.new("SpecialMesh", gun)
- gunmesh.MeshType=Enum.MeshType.FileMesh
- gunmesh.MeshId="rbxassetid://4372594"
- gunmesh.TextureId="rbxassetid://0"
- gunmesh.VertexColor=Vector3.new(0, 0, 0)
- w=Instance.new("Weld", box)
- w.Part0=box
- w.Part1=gun
- w.C0=CFrame.new(2.20000076, 0.700000048, -1, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- local gyro=Instance.new("BodyGyro", box)
- gyro.maxTorque=Vector3.new(math.huge, math.huge, 0)
- gyro.P=10000
- local startTime=nil
- local oldBestPlaya
- local currentmsg=""
- model:MoveTo(player.Character.Torso.Position-Vector3.new(0, 1, 5))
- math.randomseed(tick())
- coroutine.wrap(function()
- while box do
- wait()
- local bestPlaya=nil
- local bestDist=math.huge
- if not oldBestPlaya or oldBestPlaya:DistanceFromCharacter(box.Position)>aggrorange then
- for _, p in pairs(game:GetService'Players':GetPlayers()) do
- 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
- bestPlaya=p
- bestDist=p:DistanceFromCharacter(box.Position)
- end
- end
- if bestPlaya then
- oldBestPlaya=bestPlaya
- startTime=tick()
- end
- end
- local p=oldBestPlaya
- if p then
- notanqqa=true
- for _, playa in pairs(nqqas) do
- if p.Name:lower()==playa:lower() then
- notanqqa=false
- end
- end
- --print(p.Name)
- gyro.cframe=CFrame.new(box.CFrame.p, p.Character:FindFirstChild("Head") and p.Character.Head.CFrame.p or p.Character:GetModelCFrame())
- if notanqqa then
- local msg=""
- local mtime=0
- for i, v in pairs(messages) do
- if i>=mtime and tick()-startTime>=i then
- msg=v
- mtime=i
- end
- end
- if currentmsg~=msg then
- currentmsg=msg
- if msg=="FIRE" then
- for i=1, 12 do
- shoot:Play()
- if p.Character and p.Character:FindFirstChild("Humanoid") then
- p.Character:FindFirstChild("Humanoid").Health=p.Character:FindFirstChild("Humanoid").Health-(p.Character:FindFirstChild("Humanoid").MaxHealth*(math.random(1, 10)/20))
- end
- if p.Character and p.Character:FindFirstChild("Humanoid") and p.Character:FindFirstChild("Humanoid").Health<=0 then
- wait(3)
- gyro.cframe=CFrame.new(0, 0, 0)
- wait(2)
- game:GetService("Chat"):Chat(box, ("any1 else???"):gsub("%%p", p.Name))
- wait(3)
- game:GetService("Chat"):Chat(box, ("dats rite"):gsub("%%p", p.Name))
- wait(5)
- oldBestPlaya=nil
- break
- end
- wait(math.random(1, 10)/8)
- end
- elseif msg~="" then
- game:GetService("Chat"):Chat(box, msg:gsub("%%p", p.Name))
- end
- end
- else
- wait(2)
- game:GetService("Chat"):Chat(box, ("yo wassup cuz"):gsub("%%p", p.Name))
- local gr=Instance.new("IntValue", p.Character)
- gr.Name="greeted"
- game:GetService("Debris"):AddItem(gr, 60);
- oldBestPlaya=nil
- wait(5)
- gyro.cframe=CFrame.new(0, 0, 0)
- end
- end
- end
- end)()
- if player.Character and player.Character:FindFirstChild("Humanoid") then
- player.Character.Humanoid:UnequipTools();
- wait()
- t:Destroy()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement