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,Mouse,mouse,UserInputService,ContextActionService = owner
- local RealPlayer = Player
- do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.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")
- ParticleEmitter4 = Instance.new("ParticleEmitter")
- PointLight5 = Instance.new("PointLight")
- Script6 = Instance.new("Script")
- LocalScript7 = Instance.new("LocalScript")
- Script8 = Instance.new("Script")
- PointLight9 = Instance.new("PointLight")
- Tool0.Name = "BanHammer"
- Tool0.Parent = mas
- Tool0.GripPos = Vector3.new(0, -1, 0)
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.Rotation = Vector3.new(90.0199966, 0, 66.4599991)
- Part1.RotVelocity = Vector3.new(-0.00235919608, 0.000430068758, 0.00397496484)
- Part1.Velocity = Vector3.new(0.00131022232, -0.00751958555, 0.00376307126)
- Part1.Size = Vector3.new(1, 4.80000019, 1)
- Part1.CFrame = CFrame.new(32.008461, 0.891610622, -25.8348217, 0.39936024, -0.916794062, -5.90707568e-05, -0.00029530219, -6.41899824e-05, -0.99999994, 0.916794002, 0.39936021, -0.000296359474)
- Part1.Position = Vector3.new(32.008461, 0.891610622, -25.8348217)
- Part1.Orientation = Vector3.new(89.9799957, -168.729996, -102.259995)
- Sound2.Name = "Boom"
- Sound2.Parent = Part1
- Sound2.SoundId = "rbxasset://sounds/Rocket shot.wav"
- Sound2.Volume = 1
- SpecialMesh3.Parent = Part1
- SpecialMesh3.MeshId = "rbxassetid://10604848"
- SpecialMesh3.TextureId = "rbxassetid://94840359"
- SpecialMesh3.MeshType = Enum.MeshType.FileMesh
- ParticleEmitter4.Parent = Part1
- ParticleEmitter4.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0, 0))
- ParticleEmitter4.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0, 0))
- PointLight5.Parent = Part1
- PointLight5.Color = Color3.new(1, 0, 0.0156863)
- PointLight5.Brightness = 9.9999998430675e+17
- PointLight5.Range = 60
- PointLight5.Color = Color3.new(1, 0, 0.0156863)
- Script6.Name = "HammerScript"
- Script6.Parent = Tool0
- table.insert(cors,sandbox(Script6,function()
- -------- OMG HAX
- r = game:service("RunService")
- Tool = script.Parent
- hammer = Tool.Handle
- local shockRing = Instance.new("Part")
- shockRing.formFactor = 2
- shockRing.Size = Vector3.new(1, 0.60, 999999)
- shockRing.Anchored = true
- shockRing.Locked = true
- shockRing.CanCollide = false
- shockRing.archivable = false
- shockRing.TopSurface = 0
- shockRing.BottomSurface = 0
- shockRing.Transparency = 1
- local decal = Instance.new("Decal")
- decal.Face = 1
- decal.Texture = "http://www.roblox.com/asset/?version=1&id=1280730"
- decal.Parent = shockRing
- local bottomDecal = decal:Clone()
- bottomDecal.Face = 4
- bottomDecal.Parent = shockRing
- function doDamage(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(humanoid.MaxHealth)
- if humanoid.Health <= 0 then
- local c = hit.CFrame
- hit.CFrame = CFrame.new(hit.Position)
- hit.CFrame = c
- end
- delay(1, function() untagHumanoid(humanoid) end)
- else
- local c = hit.CFrame hit:BreakJoints() hit.CFrame = CFrame.new(hit.Position) hit.CFrame = c
- 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 blow(obj, pos, notme)
- if (obj ~= notme) then
- if (obj.className == "Part") or (obj.className == "Seat") then
- if (not obj.Anchored) and (((pos - obj.Position) * Vector3.new(1, 0, 1)).magnitude < 96) and (pos.y <= obj.Position.y + 8) and (pos.y >= obj.Position.y - 8) then
- delay((pos - obj.Position).magnitude / 96, function() doDamage(obj) obj.Velocity = ((obj.Position - pos).unit + Vector3.new(0, 0.5, 0)) * 96 + obj.Velocity obj.RotVelocity = obj.RotVelocity + Vector3.new(obj.Position.z - pos.z, 0, pos.x - obj.Position.x).unit * 40 end)
- end
- elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
- local list = obj:GetChildren()
- for x = 1, #list do
- blow(list[x], pos, notme)
- end
- end
- end
- end
- function attack()
- damage = slash_damage
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Slash"
- anim.Parent = Tool
- wait(0.2)
- print("Blasting!")
- local pos = hammer.CFrame * (Vector3.new(0, 1.4, 0) * hammer.Mesh.Scale)
- blow(workspace, pos, Tool.Parent)
- shockRing.CFrame = CFrame.new(pos)
- for x = 1, 29 do
- delay(x / 30, function() shockRing.Parent = nil shockRing.Size = Vector3.new(0, 0.4, 0) + Vector3.new(6.4, 0, 6.4) * x shockRing.Parent = Tool end)
- end
- delay(1, function() shockRing.Parent = nil end)
- end
- Tool.Enabled = true
- 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
- hammer.Boom:Play()
- attack()
- wait(0.5)
- Tool.Enabled = true
- end
- script.Parent.Activated:connect(onActivated)
- --script.Parent.Equipped:connect(onEquipped)
- end))
- LocalScript7.Name = "Local Gui"
- LocalScript7.Parent = Tool0
- Script8.Name = "PUT THIS IN THE WEAPON"
- Script8.Parent = Tool0
- table.insert(cors,sandbox(Script8,function()
- local debounce = false
- function getPlayer(humanoid)
- local players = game.Players:children()
- for i = 1, #players do
- if players[i].Character.Humanoid == humanoid then return players[i] end
- end
- return nil
- end
- function onTouch(part)
- local human = part.Parent:findFirstChild("Humanoid")
- if (human ~= nil) and debounce == false then
- debounce = true
- local player = getPlayer(human)
- if (player == nil) then return end
- script.Parent:clone().Parent = player.Backpack
- wait(2)
- debounce = false
- end
- end
- script.Parent.Parent.Touched:connect(onTouch)
- end))
- PointLight9.Parent = Tool0
- PointLight9.Color = Color3.new(0.666667, 0, 1)
- PointLight9.Brightness = 9.9999996802857e+37
- PointLight9.Range = 60
- PointLight9.Color = Color3.new(0.666667, 0, 1)
- 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