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 V2 by Mokiros")
- local RealPlayer = RealPlayer
- script.Parent = RealPlayer.Character
- --Fake event to make stuff like Mouse.KeyDown work
- local Disconnect_Function = function(this)
- this[1].Functions[this[2]] = nil
- end
- local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
- local FakeEvent_Metatable = {__index={
- Connect = function(this,f)
- local i = tostring(math.random(0,10000))
- while this.Functions[i] do
- i = tostring(math.random(0,10000))
- end
- this.Functions[i] = f
- return setmetatable({this,i},Disconnect_Metatable)
- end
- }}
- FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
- local function fakeEvent()
- return setmetatable({Functions={}},FakeEvent_Metatable)
- end
- --Creating fake input objects with fake variables
- local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- FakeMouse.keyUp = FakeMouse.KeyUp
- FakeMouse.keyDown = FakeMouse.KeyDown
- 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 TriggerEvent(self,ev,...)
- for _,f in pairs(self[ev].Functions) do
- f(...)
- end
- end
- FakeMouse.TriggerEvent = TriggerEvent
- UIS.TriggerEvent = TriggerEvent
- --Client communication
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=RealPlayer then return end
- FakeMouse.Target = io.Target
- FakeMouse.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return FakeMouse:TriggerEvent(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
- FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
- local Mouse = owner:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,RobloxHandled)
- if RobloxHandled 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 every second frame, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- local HB = game:GetService("RunService").Heartbeat
- while true 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
- --Wait 2 frames
- for i=1,2 do
- HB:Wait()
- end
- end]==],script)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local RealGame = game
- --Metatable for fake service
- local FakeService_Metatable = {
- __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 RealGame:GetService(RealService) or RealService
- return setmetatable(t,FakeService_Metatable)
- end
- --Fake game object
- local FakeGame = {
- GetService = function(self,s)
- return rawget(self,s) or RealGame:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = RealGame: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(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
- FakeGame.service = FakeGame.GetService
- FakeService(FakeGame,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = FakeGame,FakeGame.Players.LocalPlayer
- end
- rod = game.Players.LocalPlayer
- rodscharacter = rod.Character
- for i,v in pairs(rodscharacter:GetChildren()) do
- if v.ClassName == "Accessory" then
- v:remove()
- v.Parent = nil
- v:Destroy()
- end
- end
- for i,v in pairs(rodscharacter.Head:GetChildren()) do
- if v.ClassName == "Decal" then
- v:remove()
- v.Parent = nil
- v:Destroy()
- end
- end
- myhumanoid = rodscharacter:FindFirstChildOfClass("Humanoid")
- swing = Instance.new("Animation",rodscharacter)
- swing.AnimationId = "rbxassetid://54584713"
- rodscharacter.Head.Transparency = 1
- rodscharacter.Torso.Transparency = 1
- rodscharacter["Left Arm"].Transparency = 1
- rodscharacter["Right Arm"].Transparency = 1
- rodscharacter["Left Leg"].Transparency = 1
- rodscharacter["Right Leg"].Transparency = 1
- rodscharacter.Head.Transparency = 1
- henryname = Instance.new("BillboardGui",rodscharacter.HumanoidRootPart)
- henryname.Size = UDim2.new(1,0,6,0)
- henryname.StudsOffset = Vector3.new(0,6,0)
- stickminname = Instance.new("TextLabel",henryname)
- stickminname.Size = UDim2.new(1,0,1,0)
- stickminname.BackgroundTransparency = 1
- stickminname.Text = "Tari"
- stickminname.TextSize = 45
- stickminname.Font = "Cartoon"
- stickminname.TextColor3 = Color3.fromRGB(0,0,255)
- henry = Instance.new("BillboardGui",rodscharacter.HumanoidRootPart)
- henry.Size = UDim2.new(3,0,6,0)
- stickmin = Instance.new("ImageLabel",henry)
- stickmin.Size = UDim2.new(1,0,1,0)
- stickmin.BackgroundTransparency = 1
- stickmin.Image = "rbxassetid://3161070846"
- hitsound = Instance.new("Sound",rodscharacter["Right Arm"])
- hitsound.SoundId = "rbxassetid://4569"
- hitsound.Volume = 0
- hitsound2 = Instance.new("Sound",rodscharacter["Right Arm"])
- hitsound2.SoundId = "rbxassetid://974037023"
- hitsound2.Volume = 3
- hitsound2.PlaybackSpeed = 0.7
- attacking = false
- rodscharacter.HumanoidRootPart.Touched:Connect(function(hit)
- if attacking == false and not hit.Parent:FindFirstChild("DEADMIDGET") and hit.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent:FindFirstChildOfClass("Humanoid").Health > 0 then
- local attacked = hit.Parent
- attacking = true
- local humanoid = attacked:FindFirstChildOfClass("Humanoid")
- humanoid.WalkSpeed = 0
- myhumanoid.WalkSpeed = 0
- hit = myhumanoid:LoadAnimation(swing)
- hit:Play()
- hitsound:Play()
- wait(2)
- hitsound2:Play()
- for i,v in pairs(attacked:GetChildren()) do
- if v.ClassName == "Part" then
- block = Instance.new("Part",attacked)
- block.Name = v.Name.." Broken"
- block.Size = Vector3.new(1,1,1)
- block.BrickColor = v.BrickColor
- block.CFrame = v.CFrame
- sound = Instance.new("Sound",block)
- sound.SoundId = "rbxassetid://179285891"
- sound.Volume = 10
- sound:Play()
- sound.Ended:Connect(function()
- sound:Destroy()
- end)
- v:Destroy()
- end
- end
- coroutine.resume(coroutine.create(function()
- target = attacked
- target.Archivable = true
- c = target:Clone()
- c.Parent = workspace
- local parts = c:GetChildren()
- for _,p in pairs(parts) do
- if p.ClassName == "Part" then
- p.Velocity = Vector3.new(p.Velocity.X + (rodscharacter.Head.CFrame.lookVector.X * 18), p.Velocity.Y + (rodscharacter.Head.CFrame.lookVector.Y * 18) + 8, p.Velocity.Z + (rodscharacter.Head.CFrame.lookVector.Z * 18))
- end
- end
- target:Destroy()
- c.Humanoid.BreakJointsOnDeath=false
- c.Humanoid.Name = "DEADMIDGET"
- c:FindFirstChildOfClass("Humanoid").PlatformStand = true
- leftleg = Instance.new("Part",c["Left Leg"])
- leftleg.Shape = "Cylinder"
- leftleg.Transparency = 1
- leftleg.Size=Vector3.new(1.4,1,1)
- leftlegweld = Instance.new("Weld",leftleg)
- leftlegweld.Part0=c["Left Leg"]
- leftlegweld.Part1=leftleg
- leftlegweld.C0=CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
- rightleg = Instance.new("Part",c["Right Leg"])
- rightleg.Shape = "Cylinder"
- rightleg.Size=Vector3.new(1.4,1,1)
- rightleg.Transparency = 1
- rightlegweld = Instance.new("Weld",leftleg)
- rightlegweld.C0=CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
- rightlegweld.Part0=c["Right Leg"]
- rightlegweld.Part1=rightleg
- rightarm = Instance.new("Part",c["Right Arm"])
- rightarm.Shape = "Cylinder"
- rightarm.Size=Vector3.new(1.4,1,1)
- rightarm.Transparency = 1
- rightarmweld = Instance.new("Weld",rightarm)
- rightarmweld.C0=CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
- rightarmweld.Part0=c["Right Arm"]
- rightarmweld.Part1=rightarm
- leftarm = Instance.new("Part",c["Left Arm"])
- leftarm.Shape = "Cylinder"
- leftarm.Size=Vector3.new(1.4,1,1)
- leftarm.Transparency = 1
- leftarmweld = Instance.new("Weld",leftarm)
- leftarmweld.C0=CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
- leftarmweld.Part0=c["Left Arm"]
- leftarmweld.Part1=leftarm
- head = Instance.new("Part",c.Head)
- head.Size=Vector3.new(1.4,1,1)
- head.Transparency = 1
- headweld = Instance.new("Weld",head)
- headweld.Part0=c.Head
- headweld.Part1=head
- player = c
- local RealTorso = player.Torso
- local RealHead = player.Head
- local RealLeftleg = player["Left Leg"]
- local RealRightleg = player["Right Leg"]
- local RealLeftArm = player["Left Arm"]
- local RealRightArm = player["Right Arm"]
- local rightarmglue = Instance.new("Glue", RealTorso)
- rightarmglue.Part0 = RealTorso
- rightarmglue.Part1 = RealRightArm
- rightarmglue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- rightarmglue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- local leftarmglue = Instance.new("Glue", RealTorso)
- leftarmglue.Part0 = RealTorso
- leftarmglue.Part1 = RealLeftArm
- leftarmglue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- leftarmglue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- local leftlegglue = Instance.new("Glue", RealTorso)
- leftlegglue.Part0 = RealTorso
- leftlegglue.Part1 = RealLeftleg
- leftlegglue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- leftlegglue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- local rightlegglue = Instance.new("Glue", RealTorso)
- rightlegglue.Part0 = RealTorso
- rightlegglue.Part1 = RealRightleg
- rightlegglue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- rightlegglue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- RealTorso["Left Hip"]:Destroy()
- RealTorso["Right Hip"]:Destroy()
- RealTorso["Left Shoulder"]:Destroy()
- RealTorso["Left Hip"]:Destroy()
- RealTorso["Right Hip"]:Destroy()
- RealTorso["Left Shoulder"]:Destroy()
- RealTorso["Left Hip"]:Destroy()
- RealTorso["Right Hip"]:Destroy()
- RealTorso["Left Shoulder"]:Destroy()
- RealTorso["Left Hip"]:Destroy()
- RealTorso["Right Hip"]:Destroy()
- RealTorso["Left Shoulder"]:Destroy()
- RealTorso.Neck:Destroy()
- player.Humanoid.BreakJointsOnDeath = false
- RealTorso.CanCollide = false
- end))
- myhumanoid.WalkSpeed = 16
- wait(0.1)
- hit:Stop()
- attacking = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement