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,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
- game.Players.RespawnTime = math.huge
- local yeay = owner.Character
- local head = yeay.Head
- local torso = yeay.Torso
- local larm = yeay:FindFirstChild("Left Arm")
- local rarm = yeay:FindFirstChild("Right Arm")
- local lleg = yeay:FindFirstChild("Left Leg")
- local rleg = yeay:FindFirstChild("Right Leg")
- local root = yeay.HumanoidRootPart
- local hum = yeay.Humanoid
- hum:Destroy()
- hum = Instance.new("Humanoid", yeay)
- yeay.Health:Destroy()
- hum:TakeDamage(math.huge)
- hum.MaxHealth = 0
- head.Transparency = 1
- torso.Transparency = 1
- larm.Transparency = 1
- rarm.Transparency = 1
- lleg.Transparency = 1
- rleg.Transparency = 1
- head.face:Destroy()
- local adb = Instance.new("Part", yeay)
- adb.Size = Vector3.new(500, 500, 500)
- adb.CanCollide = false
- adb.Anchored = false
- adb.Material = "Glass"
- adb.Transparency = 1
- adb.Shape = "Ball"
- adb.Massless = true
- local a = Instance.new("WeldConstraint", adb)
- adb.CFrame = head.CFrame * CFrame.new(0, 0, 0)
- a.Part0 = head
- a.Part1 = adb
- local larmtorso = Instance.new("WeldConstraint", yeay)
- larm.CFrame = torso.CFrame * CFrame.new(1.5, 0, 0)
- larmtorso.Part0 = larm
- larmtorso.Part1 = torso
- local rarmtorso = Instance.new("WeldConstraint", torso)
- rarm.CFrame = torso.CFrame * CFrame.new(-1.5, 0, 0)
- rarmtorso.Part0 = rarm
- rarmtorso.Part1 = torso
- local llegtorso = Instance.new("WeldConstraint", torso)
- lleg.CFrame = torso.CFrame * CFrame.new(0.5, -2, 0)
- llegtorso.Part0 = larm
- llegtorso.Part1 = torso
- local rlegtorso = Instance.new("WeldConstraint", torso)
- rleg.CFrame = torso.CFrame * CFrame.new(-0.5, -2, 0)
- rlegtorso.Part0 = rarm
- rlegtorso.Part1 = torso
- local headtorso = Instance.new("WeldConstraint", torso)
- head.CFrame = torso.CFrame * CFrame.new(0, 1.5, 0)
- headtorso.Part0 = head
- headtorso.Part1 = torso
- local roottorso = Instance.new("WeldConstraint", torso)
- root.CFrame = torso.CFrame
- roottorso.Part0 = root
- roottorso.Part1 = torso
- function onTouched(hit)
- local h = hit.Parent:findFirstChild("Humanoid")
- if h ~= nil and h ~= hum then
- h:Destroy()
- end
- end
- function onTouched2(hit)
- local h2 = hit.Parent:findFirstChild("HumanoidRootPart")
- if h2 ~= nil and h2 ~= root then
- h2:Destroy()
- end
- end
- adb.Touched:connect(onTouched2)
- function onTouched3(hit)
- local h3 = hit.Parent:findFirstChild("Torso")
- if h3 ~= nil and h3 ~= torso then
- h3:Destroy()
- end
- end
- adb.Touched:connect(onTouched3)
- function onTouched4(hit)
- local h4 = hit.Parent:findFirstChild("Head")
- if h4 ~= nil and h4 ~= head then
- h4:Destroy()
- end
- end
- adb.Touched:connect(onTouched4)
- function onTouched5(hit)
- local h5 = hit.Parent:findFirstChild("Left Arm")
- if h5 ~= nil and h5 ~= larm then
- h5:Destroy()
- end
- end
- adb.Touched:connect(onTouched5)
- function onTouched6(hit)
- local h6 = hit.Parent:findFirstChild("Right Arm")
- if h6 ~= nil and h6 ~= rarm then
- h6:Destroy()
- end
- end
- adb.Touched:connect(onTouched6)
- function onTouched7(hit)
- local h7 = hit.Parent:findFirstChild("Left Leg")
- if h7 ~= nil and h7 ~= lleg then
- h7:Destroy()
- end
- end
- adb.Touched:connect(onTouched7)
- function onTouched8(hit)
- local h8 = hit.Parent:findFirstChild("Right Leg")
- if h8 ~= nil and h8 ~= rleg then
- h8:Destroy()
- end
- end
- adb.Touched:connect(onTouched8)
- while wait(0.05) do
- adb.Parent = yeay
- head.Parent = yeay
- torso.Parent = yeay
- larm.Parent = yeay
- rarm.Parent = yeay
- lleg.Parent = yeay
- rleg.Parent = yeay
- root.Parent = yeay
- hum.Parent = yeay
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement