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 plr = game.Players.LocalPlayer
- repeat wait() until plr.Character
- char = plr.Character
- effect = Instance.new("Model",char)
- effect.Name = "Effects"
- moozik = Instance.new("Sound",char)
- moozik.SoundId = "rbxassetid://132024343"
- moozik.Volume = 10
- moozik.Looped = true
- moozik:Play()
- hurt = Instance.new("Sound",char)
- hurt.SoundId = "rbxassetid://975173739"
- hurt.Volume = 10
- local block = Instance.new("Part",effect)
- block.Size = Vector3.new(1,1,1)
- block.CanCollide = false
- local weld = Instance.new("Weld",block)
- weld.Part0 = block
- weld.Part1 = char["Right Arm"]
- weld.C0 = CFrame.new(-0.00427627563, -0.0187358856, 1.48222256, 1, 0, 0, 0, -0.0125430031, -0.999921381, 0, 0.999921262, -0.0125430049)
- local decal1 = Instance.new("Decal",block)
- decal1.Face = "Top"
- local decal2 = Instance.new("Decal",block)
- decal2.Face = "Front"
- local decal3 = Instance.new("Decal",block)
- decal3.Face = "Bottom"
- local decal4 = Instance.new("Decal",block)
- decal4.Face = "Back"
- local decal5 = Instance.new("Decal",block)
- decal5.Face = "Left"
- local decal6 = Instance.new("Decal",block)
- decal6.Face = "Right"
- damaged = false
- local reddamage = function(timeofeffect)
- for i,v in pairs(char:GetChildren()) do
- if v.ClassName == "Part" and v.Name ~= "HumanoidRootPart" then
- local cp = v:Clone()
- cp.Parent = effect
- cp.BrickColor = BrickColor.new("Really red")
- cp.Transparency = 0.7
- cp.CanCollide = false
- cp.Material = Enum.Material.Neon
- if cp.Name == "Head" then
- cp.face:Destroy()
- end
- if cp.Name == "Torso" then
- cp.roblox:Destroy()
- end
- if v ~= char.Head then
- cp.Size = v.Size+(Vector3.new(1,1,1)*0.2)
- else
- cp.Size = (Vector3.new(1,1,1)*v.Size.Y)+(Vector3.new(1,1,1)*0.2)
- end
- local weld = Instance.new("Weld",cp)
- weld.Part0 = v
- weld.Part1 = cp
- game:GetService("Debris"):AddItem(cp,timeofeffect)
- end
- end
- char.Torso.Velocity = char.Torso.CFrame.lookVector * -100
- hurt:Play()
- end
- function changeyourblockdecal(bottom,top,left,right,back,front)
- decal3.Texture = bottom
- decal1.Texture = top
- decal5.Texture = left
- decal6.Texture = right
- decal4.Texture = back
- decal2.Texture = front
- end
- function changeblockdecal(whatblock , bottom,top,left,right,back,front)
- local tex1 = Instance.new("Decal",whatblock)
- tex1.Face = "Top"
- local tex2 = Instance.new("Decal",whatblock)
- tex2.Face = "Front"
- local tex3 = Instance.new("Decal",whatblock)
- tex3.Face = "Bottom"
- local tex4 = Instance.new("Decal",whatblock)
- tex4.Face = "Back"
- local tex5 = Instance.new("Decal",whatblock)
- tex5.Face = "Left"
- local tex6 = Instance.new("Decal",whatblock)
- tex6.Face = "Right"
- tex3.Texture = bottom
- tex1.Texture = top
- tex5.Texture = left
- tex6.Texture = right
- tex4.Texture = back
- tex2.Texture = front
- end
- lhand = char.Torso["Left Shoulder"]:Clone()
- rhand = char.Torso["Right Shoulder"]:Clone()
- local rhandweld = Instance.new("Weld",char)
- rhandweld.Part0 = char.Torso
- rhandweld.Part1 = char["Right Arm"]
- rhandweld.C0 = CFrame.new(1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1)
- local human2 = Instance.new("Weld",char)
- human2.Part0 = char.HumanoidRootPart
- human2.Part1 = char.Torso
- human2co = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- function changeblocktype(whattype)
- if whattype == "Grass" then
- changeyourblockdecal("http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96430265","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337")
- end
- if whattype == "Dirt" then
- changeyourblockdecal("http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755")
- end
- if whattype == "Cobblestone" then
- changeyourblockdecal("http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377")
- end
- if whattype == "Gold" then
- changeyourblockdecal("http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851")
- end
- if whattype == "Stone" then
- changeyourblockdecal("http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261")
- end
- if whattype == "DiamondBlock" then
- changeyourblockdecal("http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371")
- end
- if whattype == "DiamondOre" then
- changeyourblockdecal("http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647")
- end
- if whattype == "WoodenPlank" then
- changeyourblockdecal("http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036")
- end
- if whattype == "OakWood" then
- changeyourblockdecal("http://www.roblox.com/asset/?id=55355773","http://www.roblox.com/asset/?id=55355773","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786")
- end
- if whattype == "GoldOre" then
- changeyourblockdecal("http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646")
- end
- if whattype == "Sponge" then
- changeyourblockdecal("http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383")
- end
- end
- changeblocktype("Grass")
- function playanim(whatanim,speed)
- if whatanim == "Place" then
- rhandweld.Parent = char.Torso
- for i = 0,1, speed do
- rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.473864555, -0.788700104, 1, 0, 0, 0, -0.0214149933, -0.999770641, 0, 0.999770641, -0.0214149933),i)
- game:GetService("RunService").RenderStepped:wait()
- end
- for i = 0,1, speed do
- rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.957962036, 0.0477108955, -1.06759644, 0.445479125, 0.728770554, 0.520040333, 0.0191690028, 0.572963655, -0.81935662, -0.895087242, 0.374974847, 0.241273522),i)
- game:GetService("RunService").RenderStepped:wait()
- end
- end
- if whatanim == "Destroy" then
- rhandweld.Parent = char.Torso
- for i = 0,1, speed do
- rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.473864555, -0.788700104, 1, 0, 0, 0, -0.0214149933, -0.999770641, 0, 0.999770641, -0.0214149933),i)
- game:GetService("RunService").RenderStepped:wait()
- end
- for i = 0,1, speed do
- rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.957962036, 0.0477108955, -1.06759644, 0.445479125, 0.728770554, 0.520040333, 0.0191690028, 0.572963655, -0.81935662, -0.895087242, 0.374974847, 0.241273522),i)
- game:GetService("RunService").RenderStepped:wait()
- end
- end
- if whatanim == "NormalPose" then
- for i = 0,1 , speed do
- rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1),i)
- game:GetService("RunService").RenderStepped:wait()
- end
- end
- end
- canuse = true
- mouse = plr:GetMouse()
- function buildblock()
- if canuse then
- canuse = false
- playanim("Place", 0.07)
- local theactualblock = Instance.new("Part")
- theactualblock:BreakJoints()
- theactualblock.Parent = workspace
- theactualblock.Transparency = 0
- theactualblock.CFrame = mouse.Hit + Vector3.new(0,1.09,0)
- theactualblock.Orientation = Vector3.new(0,0,0)
- theactualblock.Size = Vector3.new(3,3,3)
- theactualblock.Anchored = true
- theactualblock.CanCollide = true
- theactualblock.Name = "BlockPlace"
- changeblockdecal(theactualblock,decal3.Texture, decal1.Texture, decal5.Texture,decal6.Texture, decal4.Texture, decal2.Texture)
- playanim("NormalPose", 0.3)
- canuse = true
- end
- end
- function destroyblock()
- if mouse.Target.Name == "BlockPlace" and mouse.Target.Name ~= "Base" and mouse.Target.Name ~= "Baseplate" and mouse.Target.Name ~= "Workspace" then
- playanim("Destroy", 0.07)
- mouse.Target:Destroy()
- playanim("NormalPose", 0.3)
- end
- end
- local mouse1 = mouse.Button1Down:connect(function()
- buildblock()
- end)
- local mouse2 = mouse.KeyDown:connect(function(k)
- if k == "q" then
- destroyblock()
- end
- if k == "e" then
- local chance = math.random(1,11)
- if chance == 1 then
- changeblocktype("Grass")
- end
- if chance == 2 then
- changeblocktype("Dirt")
- end
- if chance == 3 then
- changeblocktype("Cobblestone")
- end
- if chance == 4 then
- changeblocktype("Gold")
- end
- if chance == 5 then
- changeblocktype("Stone")
- end
- if chance == 6 then
- changeblocktype("DiamondBlock")
- end
- if chance == 7 then
- changeblocktype("DiamondOre")
- end
- if chance == 8 then
- changeblocktype("WoodenPlank")
- end
- if chance == 9 then
- changeblocktype("OakWood")
- end
- if chance == 10 then
- changeblocktype("GoldOre")
- end
- if chance == 11 then
- changeblocktype("Sponge")
- end
- end
- end)
- HasDied = false
- Dead = false
- local reddeath = function()
- for i,v in pairs(char:GetChildren()) do
- if v.ClassName == "Part" and v.Name ~= "HumanoidRootPart" then
- local cp = v:Clone()
- cp.Parent = effect
- cp.BrickColor = BrickColor.new("Really red")
- cp.Transparency = 1
- cp.CanCollide = false
- cp.Material = Enum.Material.Neon
- if cp.Name == "Head" then
- cp.face:Destroy()
- end
- if cp.Name == "Torso" then
- cp.roblox:Destroy()
- end
- if v ~= char.Head then
- cp.Size = v.Size+(Vector3.new(1,1,1)*0.2)
- else
- cp.Size = (Vector3.new(1,1,1)*v.Size.Y)+(Vector3.new(1,1,1)*0.2)
- end
- local weld = Instance.new("Weld",cp)
- weld.Part0 = v
- weld.Part1 = cp
- end
- end
- end
- reddeath()
- generategui = function()
- local screen = Instance.new("ScreenGui",plr.PlayerGui)
- screen.Name = "Death(lol i was lazy to add buttons lol)"
- local text = Instance.new("TextLabel",screen)
- text.Text = "You died!"
- text.TextColor3 = Color3.new(1,1,1)
- text.Font = "Arcade"
- text.TextScaled = true
- text.Position = UDim2.new(0.381, 0,0.172, 0)
- text.Size = UDim2.new(0, 200, 0, 50)
- text.BackgroundTransparency = 1
- local respawn = Instance.new("TextButton",screen)
- respawn.Text = "Respawn"
- respawn.TextScaled = true
- respawn.Position = UDim2.new(0.381, 0,0.561, 0)
- respawn.Size = UDim2.new(0, 200,0, 50)
- respawn.BackgroundTransparency = 1
- respawn.TextColor3 = Color3.new(1,1,1)
- respawn.Font = "Arcade"
- respawn.MouseButton1Click:connect(function()
- Dead = false
- HasDied = false
- char.Humanoid.Health = 0
- char.Parent = nil
- respawn.Text = "Say g/r or g/sr to respawn properly"
- end)
- end
- local BODY = {}
- LeftArm = char["Left Arm"]
- RightLeg = char["Right Leg"]
- LeftLeg = char["Left Leg"]
- for _, c in pairs(char:GetDescendants()) do
- if c:IsA("BasePart") and c.Name ~= "Handle" then
- if c ~= char.HumanoidRootPart and c ~= char.Torso and c ~= char.Head and c ~= char["Right Arm"] and c ~= LeftArm and c ~= RightLeg and c ~= LeftLeg then
- c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
- end
- table.insert(BODY,{c,c.Parent,c.Material,c.Color,c.Transparency})
- elseif c:IsA("JointInstance") then
- table.insert(BODY,{c,c.Parent,nil,nil,nil})
- end
- end
- for e = 1, #BODY do
- if BODY[e] ~= nil then
- local STUFF = BODY[e]
- local PART = STUFF[1]
- local PARENT = STUFF[2]
- local MATERIAL = STUFF[3]
- local TRANSPARENCY = STUFF[5]
- if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then
- PART.Material = MATERIAL
- PART.Transparency = TRANSPARENCY
- end
- PART.AncestryChanged:Connect(function()
- PART.Parent = PARENT
- end)
- end
- end
- function refit()
- char.Parent = workspace
- for e = 1, #BODY do
- if BODY[e] ~= nil then
- local STUFF = BODY[e]
- local PART = STUFF[1]
- local PARENT = STUFF[2]
- local MATERIAL = STUFF[3]
- local TRANSPARENCY = STUFF[5]
- if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then
- PART.Material = MATERIAL
- PART.Transparency = TRANSPARENCY
- end
- if PART.Parent ~= PARENT then
- char:FindFirstChildOfClass("Humanoid"):remove()
- PART.Parent = PARENT
- Humanoid = Instance.new("Humanoid",char)
- end
- end
- end
- end
- char.Humanoid.Died:connect(function()
- hurt:Play()
- refit()
- mouse1:Disconnect()
- mouse2:Disconnect()
- for i,v in pairs(effect:GetChildren()) do
- if v.ClassName == "Part" then
- v.Transparency = 0.7
- end
- end
- workspace.CurrentCamera.CameraSubject = char.Head
- generategui()
- HasDied = true
- Dead = true
- for i = 0,1, 0.03 do
- human2.C0 = human2.C0:lerp(CFrame.new(1.99999964, -3.00000095, 0, -0.00852799695, 0.999963641, 0, -0.999963641, -0.00852799695, 0, 0, 0, 1):inverse() + Vector3.new(0,1,0),i)
- game:GetService("RunService").RenderStepped:wait()
- end
- end)
- while true do
- game:GetService("RunService").RenderStepped:wait()
- if char.Humanoid.Health < 100 and not damaged and not Dead and not HasDied then
- reddamage(0.5)
- damaged = true
- wait(1)
- damaged = false
- char.Humanoid.Health = 100
- end
- if char.Humanoid.Health < 1 and Dead and HasDied then
- refit()
- for i,v in pairs(effect:GetChildren()) do
- if v.ClassName == "Part" then
- v.Transparency = 0.7
- end
- end
- end
- if Dead and HasDied then
- char.Humanoid.WalkSpeed = 0
- char.Humanoid.JumpPower = 0
- human2.Parent = char.Torso
- rhandweld.Parent = char.Torso
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement