Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This script has been converted to FE by iPxter
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
- script.Parent = Player.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,Connect=function(self,f)self.Function=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()}
- 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 and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- 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 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})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- 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)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- --EXPLODE!!!
- 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")
- LocalScript1 = Instance.new("LocalScript")
- LocalScript2 = Instance.new("LocalScript")
- Script3 = Instance.new("Script")
- Part4 = Instance.new("Part")
- SpecialMesh5 = Instance.new("SpecialMesh")
- Script6 = Instance.new("Script")
- Folder7 = Instance.new("Folder")
- Sound8 = Instance.new("Sound")
- Sound9 = Instance.new("Sound")
- Sound10 = Instance.new("Sound")
- Sound11 = Instance.new("Sound")
- Sound12 = Instance.new("Sound")
- ParticleEmitter13 = Instance.new("ParticleEmitter")
- Tool0.Name = "SUPEREXTREMEENENERGYSWORDOFDOOM!"
- Tool0.Parent = mas
- Tool0.TextureId = "rbxassetid://1467748392"
- Tool0.GripForward = Vector3.new(-1, -0, -0)
- Tool0.GripPos = Vector3.new(0, 0, -1.5)
- Tool0.GripRight = Vector3.new(0, 1, 0)
- Tool0.GripUp = Vector3.new(0, 0, 1)
- Tool0.ToolTip = "supercalifragilisticexpialidocious!"
- LocalScript1.Name = "Local Gui"
- LocalScript1.Parent = Tool0
- LocalScript2.Name = "FirstPersonArms"
- LocalScript2.Parent = Tool0
- table.insert(cors,sandbox(LocalScript2,function()
- wait(0.2)
- local player=owner
- local camera=workspace.CurrentCamera
- local tool=script.Parent
- local char=player.Character
- SETTINGS={
- FIRST_PERSON={
- left_arm=true, --if left arm is Enabled
- right_arm=true, --If right arm is Enabled
- arm_transparency=0.4, --The transparency of the Arms
- arm_color=BrickColor.new("Really black"), --The colo(u)r of the arms, If below is set to true, This will be the BrickColor of the Arms.
- change_color=true, --Changes the colo(u)r of the arms, If false, Will set them as the Players arm colo(u)r
- },
- }
- function FirstPerson()
- if (camera.focus.p - camera.CoordinateFrame.p).magnitude > 1 then
- return false
- else
- return true
- end
- end
- function Start()
- anim_arms=Instance.new("Model")
- anim_arms.Name="Arms_Model"
- local r,l = char:FindFirstChild("Right Arm"):clone(), char:FindFirstChild("Left Arm"):clone()
- if r and SETTINGS.FIRST_PERSON.right_arm then
- r.Transparency=SETTINGS.FIRST_PERSON.arm_transparency
- r.Material=Enum.Material.SmoothPlastic
- if SETTINGS.FIRST_PERSON.change_color then
- r.BrickColor=SETTINGS.FIRST_PERSON.arm_color
- end
- end
- if l and SETTINGS.FIRST_PERSON.left_arm then
- l.Transparency=SETTINGS.FIRST_PERSON.arm_transparency
- l.Material=Enum.Material.SmoothPlastic
- if SETTINGS.FIRST_PERSON.change_color then
- l.BrickColor=SETTINGS.FIRST_PERSON.arm_color
- end
- end
- local rw,lw,h = Instance.new("Weld"),Instance.new("Weld"), Instance.new("Humanoid")
- if rw and SETTINGS.FIRST_PERSON.right_arm then
- rw.Part0=r
- rw.Part1=char:FindFirstChild("Right Arm")
- rw.Parent=r
- r.Parent=anim_arms
- end
- if lw and SETTINGS.FIRST_PERSON.left_arm then
- lw.Part0=l
- lw.Part1=char:FindFirstChild("Left Arm")
- lw.Parent=l
- l.Parent=anim_arms
- end
- if SETTINGS.FIRST_PERSON.right_arm then
- if r:FindFirstChild("RightGrip")~=nil then r:FindFirstChild("RightGrip"):Destroy() end
- end
- while equipped do
- if FirstPerson() then
- if anim_arms ~= nil then
- anim_arms.Parent=camera
- end
- else
- if anim_arms ~= nil then
- anim_arms.Parent=nil
- end
- end
- wait()
- end
- end
- function End()
- anim_arms:Destroy()
- anim_arms=nil
- end
- tool.Equipped:connect(function ()
- equipped=true
- Start()
- end)
- tool.Unequipped:connect(function ()
- equipped=false
- End()
- end)
- end))
- Script3.Name = "SwordScript"
- Script3.Parent = Tool0
- table.insert(cors,sandbox(Script3,function()
- --rbxsig%SvOCRfs4MS09DiFeZ9ryb0KVTZKM2pYFaz18031HaaiHrZnjsJ+iWsDsSxTs3c1kYMSB0HlSbgzhXXww3xOBUhW0xm1/5mi4O0KnHYGSc4eBTonK6ryFiCwTrBSmrG59TVp2eG6uctncdw9z3Eo/RyJSCFHXct6N9imKE9Qsdco=%
- --rbxassetid%1014475%
- -------- OMG HAX
- r = game:service("RunService")
- local damage = 5
- local slash_damage = 10
- local lunge_damage = 30
- 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 LungeSound = Instance.new("Sound")
- LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
- LungeSound.Parent = sword
- LungeSound.Volume = .6
- local UnsheathSound = Instance.new("Sound")
- UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
- UnsheathSound.Parent = sword
- UnsheathSound.Volume = 1
- function blow(hit)
- if (hit.Parent == nil) then return end -- happens when bullet hits sword
- 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
- -- final check, make sure sword is in-hand
- local right_arm = vCharacter:FindFirstChild("Right Arm")
- if (right_arm ~= nil) then
- local joint = right_arm:FindFirstChild("RightGrip")
- if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- wait(1)
- untagHumanoid(humanoid)
- end
- end
- 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 lunge()
- damage = lunge_damage
- LungeSound:play()
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Lunge"
- anim.Parent = Tool
- force = Instance.new("BodyVelocity")
- force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
- force.Parent = Tool.Parent.Torso
- wait(.25)
- swordOut()
- wait(.25)
- force.Parent = nil
- wait(.5)
- swordUp()
- damage = slash_damage
- end
- function swordUp()
- Tool.GripForward = Vector3.new(-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()
- if (t - last_attack < .2) then
- lunge()
- else
- attack()
- end
- 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))
- Part4.Name = "Handle"
- Part4.Parent = Tool0
- Part4.BrickColor = BrickColor.new("Dark stone grey")
- Part4.Reflectance = 1
- Part4.Rotation = Vector3.new(90, 0, -90)
- Part4.FormFactor = Enum.FormFactor.Plate
- Part4.Size = Vector3.new(1, 0.800000012, 4)
- Part4.CFrame = CFrame.new(-43.5999985, 2.400002, -62.5, 0, 1, 0, 0, 0, -1, -1, 0, 0)
- Part4.BottomSurface = Enum.SurfaceType.Smooth
- Part4.TopSurface = Enum.SurfaceType.Smooth
- Part4.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part4.Position = Vector3.new(-43.5999985, 2.400002, -62.5)
- Part4.Orientation = Vector3.new(90, 90, 0)
- Part4.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh5.Parent = Part4
- SpecialMesh5.MeshId = "rbxasset://fonts/sword.mesh"
- SpecialMesh5.TextureId = "http://www.roblox.com/asset/?id=5837725"
- SpecialMesh5.MeshType = Enum.MeshType.FileMesh
- Script6.Name = "Explode"
- Script6.Parent = Part4
- table.insert(cors,sandbox(Script6,function()
- Booms = script.Sound:GetChildren()
- function onTouched(part)
- if part.Parent ~= nil then
- local humanoid = part.Parent:findFirstChild("Humanoid")
- if humanoid and debounce==nil then
- debounce = true
- --script.Parent.Parent = nil
- humanoid.Parent:BreakJoints()
- local explosion = Instance.new("Explosion")
- explosion.BlastRadius = 3
- explosion.BlastPressure = 0
- explosion.Position = part.Position
- explosion.Parent = game.Workspace
- local explode = Booms[math.random(1,#Booms)]:Clone()
- explode.Parent = humanoid.Parent.Head
- explode:Play()
- wait(1)
- debounce = nil
- end
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Folder7.Name = "Sound"
- Folder7.Parent = Script6
- Sound8.Name = "Explode1"
- Sound8.Parent = Folder7
- Sound8.SoundId = "rbxassetid://141679994"
- Sound9.Name = "Explode2"
- Sound9.Parent = Folder7
- Sound9.SoundId = "rbxassetid://679798995"
- Sound10.Name = "Explode3"
- Sound10.Parent = Folder7
- Sound10.SoundId = "rbxassetid://498657996"
- Sound10.Volume = 10
- Sound11.Name = "Explode4"
- Sound11.Parent = Folder7
- Sound11.SoundId = "rbxassetid://133680244"
- Sound12.Name = "Explode5"
- Sound12.Parent = Folder7
- Sound12.SoundId = "rbxassetid://633130540"
- ParticleEmitter13.Name = "Lightning"
- ParticleEmitter13.Parent = Part4
- ParticleEmitter13.Rotation = NumberRange.new(5, 180)
- ParticleEmitter13.Size = NumberSequence.new(2,2)
- ParticleEmitter13.Color = ColorSequence.new(Color3.new(0.670588, 0.968628, 1),Color3.new(0.670588, 0.968628, 1))
- ParticleEmitter13.LightEmission = 0.5
- ParticleEmitter13.Texture = "http://www.roblox.com/asset/?id=281983242"
- ParticleEmitter13.ZOffset = 2
- ParticleEmitter13.Lifetime = NumberRange.new(0.10000000149012, 0.10000000149012)
- ParticleEmitter13.Speed = NumberRange.new(2, 2)
- ParticleEmitter13.Color = ColorSequence.new(Color3.new(0.670588, 0.968628, 1),Color3.new(0.670588, 0.968628, 1))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = owner.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