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"))
- Script0 = Instance.new("Script")
- Script1 = Instance.new("Script")
- LocalScript2 = Instance.new("LocalScript")
- Part3 = Instance.new("Part")
- SpecialMesh4 = Instance.new("SpecialMesh")
- Sound5 = Instance.new("Sound")
- Tool6 = Instance.new("Tool")
- Part7 = Instance.new("Part")
- SpecialMesh8 = Instance.new("SpecialMesh")
- Sound9 = Instance.new("Sound")
- Script10 = Instance.new("Script")
- Script11 = Instance.new("Script")
- LocalScript12 = Instance.new("LocalScript")
- Script10.Name = "Destroy"
- Script10.Parent = Tool6
- table.insert(cors,sandbox(Script10,function()
- local Tool = script.Parent --make sure this is a Tool object
- Tool.Equipped:connect(function(Mouse)
- Mouse.Button1Down:connect(function()
- script.Parent.Handle.Touched:connect(function(hit)
- hit.Transparency = 0
- for n = 1,40 do
- wait()
- hit.BrickColor = BrickColor.Random()
- end
- wait()
- hit:Destroy()
- end)
- end)
- end)
- end))
- Script11.Name = "Sword Script"
- Script11.Parent = Tool6
- table.insert(cors,sandbox(Script11,function()
- -------- OMG HAX
- r = game:service("RunService")
- local damage = 10
- local slash_damage = 10
- sword = script.Parent.Handle
- Tool = script.Parent
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
- SlashSound.Parent = sword
- SlashSound.Volume = .7
- local UnsheathSound = Instance.new("Sound")
- UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
- UnsheathSound.Parent = sword
- UnsheathSound.Volume = 1
- function blow(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
- if humanoid~=nil and humanoid ~= hum and hum ~= nil then
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- wait(1)
- untagHumanoid(humanoid)
- end
- end
- function tagHumanoid(humanoid, player)
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = player
- creator_tag.Name = "creator"
- creator_tag.Parent = humanoid
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- function attack()
- damage = slash_damage
- SlashSound:play()
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Slash"
- anim.Parent = Tool
- end
- function swordUp()
- Tool.GripForward = Vector3.new(-1.1,0,0)
- Tool.GripRight = Vector3.new(0,1,0)
- Tool.GripUp = Vector3.new(0,0,1)
- end
- function swordOut()
- Tool.GripForward = Vector3.new(0,0,1)
- Tool.GripRight = Vector3.new(0,-1,0)
- Tool.GripUp = Vector3.new(-1,0,0)
- end
- function swordAcross()
- -- parry
- end
- Tool.Enabled = true
- local last_attack = 0
- function onActivated()
- if not Tool.Enabled then
- return
- end
- Tool.Enabled = false
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- t = r.Stepped:wait()
- attack()
- last_attack = t
- --wait(.5)
- Tool.Enabled = true
- end
- function onEquipped()
- UnsheathSound:play()
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Equipped:connect(onEquipped)
- connection = sword.Touched:connect(blow)
- end))
- LocalScript12.Name = "Local Gui"
- LocalScript12.Parent = Tool6
- Part7.Name = "Handle"
- Part7.Parent = Tool6
- Part7.BrickColor = BrickColor.new("Dark stone grey")
- Part7.Reflectance = 0.40000000596046
- Part7.Rotation = Vector3.new(-90.0299988, -0.0399999991, -35.3699989)
- Part7.Locked = true
- Part7.FormFactor = Enum.FormFactor.Plate
- Part7.Size = Vector3.new(1, 0.800000012, 3)
- Part7.CFrame = CFrame.new(-1567.85327, 1.50039995, -2444.01294, 0.815435171, 0.578847528, -0.000649310299, 0.000796274282, -3.93885717e-21, 0.999999642, 0.578847408, -0.81543535, -0.000460921437)
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part7.Position = Vector3.new(-1567.85327, 1.50039995, -2444.01294)
- Part7.Orientation = Vector3.new(-89.9499969, -125.369995, 90)
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh8.Parent = Part7
- SpecialMesh8.MeshId = "http://www.roblox.com/asset/?id=16198309"
- SpecialMesh8.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- SpecialMesh8.TextureId = "http://www.roblox.com/asset/?id=16198294"
- SpecialMesh8.MeshType = Enum.MeshType.FileMesh
- SpecialMesh8.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- Sound9.Parent = Part7
- Sound9.SoundId = "http://www.roblox.com/Asset/?ID=12135982"
- Sound9.Volume = 0.69999998807907
- Tool6.Name = "DeleteTool"
- Tool6.Parent = mas
- Tool6.TextureId = "http://www.roblox.com/asset?id=73241901"
- Tool6.GripForward = Vector3.new(-1, -0, -0)
- Tool6.GripPos = Vector3.new(0, 0, -0.5)
- Tool6.GripRight = Vector3.new(0, 1, 0)
- Tool6.GripUp = Vector3.new(0, 0, 1)
- Tool6.ToolTip = "Delete"
- Part7.Name = "Handle"
- Part7.Parent = Tool6
- Part7.BrickColor = BrickColor.new("Dark stone grey")
- Part7.Reflectance = 0.40000000596046
- Part7.Rotation = Vector3.new(-90.0299988, -0.0399999991, -35.3699989)
- Part7.Locked = true
- Part7.FormFactor = Enum.FormFactor.Plate
- Part7.Size = Vector3.new(1, 0.800000012, 3)
- Part7.CFrame = CFrame.new(-1567.85327, 1.50039995, -2444.01294, 0.815435171, 0.578847528, -0.000649310299, 0.000796274282, -3.93885717e-21, 0.999999642, 0.578847408, -0.81543535, -0.000460921437)
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part7.Position = Vector3.new(-1567.85327, 1.50039995, -2444.01294)
- Part7.Orientation = Vector3.new(-89.9499969, -125.369995, 90)
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh8.Parent = Part7
- SpecialMesh8.MeshId = "http://www.roblox.com/asset/?id=16198309"
- SpecialMesh8.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- SpecialMesh8.TextureId = "http://www.roblox.com/asset/?id=16198294"
- SpecialMesh8.MeshType = Enum.MeshType.FileMesh
- SpecialMesh8.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
- Sound9.Parent = Part7
- Sound9.SoundId = "http://www.roblox.com/Asset/?ID=12135982"
- Sound9.Volume = 0.69999998807907
- Script10.Name = "Destroy"
- Script10.Parent = Tool6
- table.insert(cors,sandbox(Script10,function()
- script.Parent.Activated:connect(function(mouse)
- mouse.KeyUp:connect(function()
- script.Parent.Handle.Touched:connect(function(hit)
- hit.Transparency = 0
- for n = 1,40 do
- wait()
- hit.BrickColor = BrickColor.Random()
- end
- wait()
- hit:Destroy()
- end)
- end)
- end)
- end))
- Script11.Name = "Sword Script"
- Script11.Parent = Tool6
- table.insert(cors,sandbox(Script11,function()
- -------- OMG HAX
- r = game:service("RunService")
- local damage = 10
- local slash_damage = 10
- sword = script.Parent.Handle
- Tool = script.Parent
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
- SlashSound.Parent = sword
- SlashSound.Volume = .7
- local UnsheathSound = Instance.new("Sound")
- UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
- UnsheathSound.Parent = sword
- UnsheathSound.Volume = 1
- function blow(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
- if humanoid~=nil and humanoid ~= hum and hum ~= nil then
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- wait(1)
- untagHumanoid(humanoid)
- end
- end
- function tagHumanoid(humanoid, player)
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = player
- creator_tag.Name = "creator"
- creator_tag.Parent = humanoid
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- function attack()
- damage = slash_damage
- SlashSound:play()
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Slash"
- anim.Parent = Tool
- end
- function swordUp()
- Tool.GripForward = Vector3.new(-1.1,0,0)
- Tool.GripRight = Vector3.new(0,1,0)
- Tool.GripUp = Vector3.new(0,0,1)
- end
- function swordOut()
- Tool.GripForward = Vector3.new(0,0,1)
- Tool.GripRight = Vector3.new(0,-1,0)
- Tool.GripUp = Vector3.new(-1,0,0)
- end
- function swordAcross()
- -- parry
- end
- Tool.Enabled = true
- local last_attack = 0
- function onActivated()
- if not Tool.Enabled then
- return
- end
- Tool.Enabled = false
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- t = r.Stepped:wait()
- attack()
- last_attack = t
- --wait(.5)
- Tool.Enabled = true
- end
- function onEquipped()
- UnsheathSound:play()
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Equipped:connect(onEquipped)
- connection = sword.Touched:connect(blow)
- end))
- LocalScript12.Name = "Local Gui"
- LocalScript12.Parent = Tool6
- 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