Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- 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 V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- Sound2 = Instance.new("Sound")
- SpecialMesh3 = Instance.new("SpecialMesh")
- Script4 = Instance.new("Script")
- LocalScript5 = Instance.new("LocalScript")
- Script6 = Instance.new("Script")
- Configuration7 = Instance.new("Configuration")
- BoolValue8 = Instance.new("BoolValue")
- Configuration9 = Instance.new("Configuration")
- NumberValue10 = Instance.new("NumberValue")
- NumberValue11 = Instance.new("NumberValue")
- StringValue12 = Instance.new("StringValue")
- BoolValue13 = Instance.new("BoolValue")
- BoolValue14 = Instance.new("BoolValue")
- StringValue15 = Instance.new("StringValue")
- ObjectValue16 = Instance.new("ObjectValue")
- Tool0.Name = "Trap"
- Tool0.Parent = mas
- Tool0.GripForward = Vector3.new(-0, 1, -0)
- Tool0.GripPos = Vector3.new(0, -0.550000012, -0.649999976)
- Tool0.GripUp = Vector3.new(0, 0, 1)
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.Rotation = Vector3.new(-90, 0, -90)
- Part1.FormFactor = Enum.FormFactor.Plate
- Part1.Size = Vector3.new(1, 3.60000014, 1)
- Part1.CFrame = CFrame.new(13.1099844, 25.6800003, 865.159973, 0, 1, 0, 0, 0, 1, 1, 0, 0)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Position = Vector3.new(13.1099844, 25.6800003, 865.159973)
- Part1.Orientation = Vector3.new(-90, -90, 0)
- Sound2.Name = "EquipSound"
- Sound2.Parent = Part1
- Sound2.SoundId = "http://www.roblox.com/asset/?id=10756118"
- SpecialMesh3.Parent = Part1
- SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=11915746"
- SpecialMesh3.TextureId = "http://www.roblox.com/asset/?id=87812844"
- SpecialMesh3.MeshType = Enum.MeshType.FileMesh
- Script4.Name = "RayGun"
- Script4.Parent = Tool0
- table.insert(cors,sandbox(Script4,function()
- local Tool = script.Parent;
- enabled = true
- local spark = Instance.new("Sparkles")
- function fire(v)
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local missile = Instance.new("Part")
- local spawnPos = vCharacter.PrimaryPart.Position
- local PewPew = Tool.Handle:FindFirstChild("PewPew")
- if (PewPew == nil) then
- PewPew = Instance.new("Sound")
- PewPew.Name = "PewPew"
- PewPew.SoundId = "http://www.roblox.com/asset/?id=11944350"
- PewPew.Parent = Tool.Handle
- PewPew.Volume = 1
- end
- spawnPos = spawnPos + (v * 10)
- missile.Position = spawnPos
- missile.Size = Vector3.new(40,40,40)
- missile.Velocity = v * 200
- missile.BrickColor = BrickColor.new("Lime green")
- missile.Shape = 2
- missile.Transparency = script.Parent.Settings.Transperancy.Value
- missile.BottomSurface = 0
- missile.TopSurface = 0
- missile.Name = script.Parent.Settings.Name
- missile.Reflectance = script.Parent.Settings.Reflect.Value
- missile.CanCollide = script.Parent.Settings.Collide.Value
- missile.Material = script.Parent.Settings.Materializer.Value
- missile.Locked = script.Parent.Settings.Locked.Value
- missile.Anchored = script.Parent.BreakSpark.Anchor.Value
- spark:Clone().Parent = missile
- spark.Color = missile.Color
- local force = Instance.new("BodyForce")
- force.force = Vector3.new(0,100,0)
- force.Parent = missile
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = vPlayer
- creator_tag.Name = "creator"
- creator_tag.Parent = missile
- local new_script = script.Parent.LaserBlast:clone()
- new_script.Disabled = false
- new_script.Parent = missile
- missile.Parent = game.Workspace
- PewPew:Play()
- end
- function gunUp()
- Tool.GripForward = Vector3.new(0,.981,-.196)
- Tool.GripRight = Vector3.new(1,0,0)
- Tool.GripUp = Vector3.new(0,.196,.981)
- end
- function gunOut()
- Tool.GripForward = Vector3.new(0,1,0)
- Tool.GripRight = Vector3.new(1,0,0)
- Tool.GripUp = Vector3.new(0,0,1)
- end
- function isTurbo(character)
- return character:FindFirstChild("BoltHelm") ~= nil
- end
- function onActivated()
- if not enabled then
- return
- end
- enabled = false
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- local targetPos = humanoid.TargetPoint
- local lookAt = (targetPos - character.Head.Position).unit
- local reload = 1
- --if (isTurbo(character)) then
- -- reload = .25
- -- print("turbo")
- --end
- gunUp()
- fire(lookAt)
- wait(reload)
- gunOut()
- wait(reload)
- enabled = true
- end
- function onEquipped()
- Tool.Handle.EquipSound:play()
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Equipped:connect(onEquipped)
- end))
- LocalScript5.Name = "Local Gui"
- LocalScript5.Parent = Tool0
- table.insert(cors,sandbox(LocalScript5,function()
- local Tool = script.Parent;
- enabled = true
- function onButton1Down(mouse)
- if not enabled then
- return
- end
- enabled = false
- mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
- wait(1)
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- enabled = true
- end
- function onEquippedLocal(mouse)
- if mouse == nil then
- print("Mouse not found")
- return
- end
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- end
- Tool.Equipped:connect(onEquippedLocal)
- end))
- Script6.Name = "LaserBlast"
- Script6.Parent = Tool0
- Script6.Disabled = true
- table.insert(cors,sandbox(Script6,function()
- ball = script.Parent
- damage = 9000
- HitSound = Instance.new("Sound")
- HitSound.Name = "HitSound"
- HitSound.SoundId = "http://www.roblox.com/asset/?id=11945266"
- HitSound.Parent = ball
- HitSound.Volume = 1
- function onTouched(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- if humanoid ~= nil then
- tagHumanoid(humanoid)
- humanoid:TakeDamage(damage)
- plyr = ball:findFirstChild("creator").Value
- plyr.leaderstats.Points.Value = plyr.leaderstats.Points.Value + 4
- wait(0.2)
- untagHumanoid(humanoid)
- end
- HitSound:Play()
- ball.Parent = nil
- end
- function tagHumanoid(humanoid)
- -- todo: make tag expire
- local tag = ball:findFirstChild("creator")
- if tag ~= nil then
- local new_tag = tag:clone()
- new_tag.Parent = humanoid
- end
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- connection = ball.Touched:connect(onTouched)
- wait(5)
- script.Parent:Destroy()
- --ball.SparkSound.Looped = false
- --ball.SparkSound:Stop()
- ball.Parent = nil
- end))
- Configuration7.Name = "BreakSpark"
- Configuration7.Parent = Tool0
- BoolValue8.Name = "Anchor"
- BoolValue8.Parent = Configuration7
- BoolValue8.Value = true
- Configuration9.Name = "Settings"
- Configuration9.Parent = Tool0
- NumberValue10.Name = "Transperancy"
- NumberValue10.Parent = Configuration9
- NumberValue10.Value = 0.5
- NumberValue11.Name = "Reflect"
- NumberValue11.Parent = Configuration9
- NumberValue11.Value = 0.4
- StringValue12.Name = "Name"
- StringValue12.Parent = Configuration9
- StringValue12.Value = "NAY"
- BoolValue13.Name = "Locked"
- BoolValue13.Parent = Configuration9
- BoolValue13.Value = true
- BoolValue14.Name = "Collide"
- BoolValue14.Parent = Configuration9
- BoolValue14.Value = true
- StringValue15.Name = "Materializer"
- StringValue15.Parent = Configuration9
- StringValue15.Value = "Neon"
- ObjectValue16.Name = "Note - This is made by Anime"
- ObjectValue16.Parent = Tool0
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement