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")
- 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
- wait(0)
- local Parts = {
- owner.Character.Torso
- }
- local w = {}
- for i = 2, 24 do
- Parts[i] = Instance.new("Part", owner.Character)
- Parts[i].BrickColor = BrickColor.Black()
- Parts[i].Material = "Granite"
- Parts[i].CanCollide = false
- Parts[i].Locked = false
- Parts[i].formFactor = "Symmetric"
- Parts[i].Size = Vector3.new(1.5, 3, 3)
- function onTouched(part)
- local h = Parts[i].Parent:findFirstChild("Humanoid")
- if h ~= nil then
- h.Health = h.Health - 0
- wait(0)
- end
- end
- Parts[i].Touched:connect(onTouched)
- Mesh = Instance.new("BlockMesh", Parts[i])
- Mesh.Name = "Mesh"
- if i > 75 then
- mult = (i - 25) / 1
- else
- mult = 0
- end
- Mesh.Scale = Vector3.new(math.abs(0.5 - (i - 0) / 50) + 0 + mult, 0.3 - (i - 0.15) / 69, 0.6)
- w[i - 1] = Instance.new("Weld", Parts[i])
- w[i - 1].Part0 = Parts[i - 1]
- w[i - 1].Part1 = Parts[i]
- w[i - 1].C0 = CFrame.new(0, 0, 0.75)
- w[i - 1].C1 = CFrame.new(0, 0, -0.75)
- end
- w[1].C0 = CFrame.new(0, -0.35, 0)
- function Smooth(WhereTo0, Welds)
- local CR0 = CFrame.new(Welds[1].C1:toEulerAnglesXYZ()).p
- local CR1 = CFrame.new(WhereTo0).p
- local AddTo0 = (CR1 - CR0) / 6.9
- for a = 1, #Welds do
- Welds[a].C1 = Welds[a].C1 * CFrame.fromEulerAnglesXYZ(AddTo0.x, AddTo0.y, AddTo0.z)
- end
- end
- local scr = Instance.new("ScreenGui", owner.PlayerGui)
- local absx = scr.AbsoluteSize.X
- local absy = scr.AbsoluteSize.Y
- scr:Destroy()
- local mouse = owner:GetMouse()
- wait(0)
- local Parts = {
- owner.Character.Torso
- }
- local w = {}
- for i = 2, 24 do
- Parts[i] = Instance.new("Part", owner.Character)
- Parts[i].BrickColor = BrickColor.Black()
- Parts[i].Material = "Granite"
- Parts[i].CanCollide = false
- Parts[i].Locked = false
- Parts[i].formFactor = "Symmetric"
- Parts[i].Size = Vector3.new(1.1, 0.9, 2.5)
- function onTouched(part)
- local h = Parts[i].Parent:findFirstChild("Humanoid")
- if h ~= nil then
- h.Health = h.Health - 0
- wait(0)
- end
- end
- Parts[i].Touched:connect(onTouched)
- Mesh = Instance.new("BlockMesh", Parts[i])
- Mesh.Name = "Mesh"
- if i > 75 then
- mult = (i - 25) / 1
- else
- mult = 0
- end
- Mesh.Scale = Vector3.new(math.abs(0.5 - (i - 0) / 50) + 0 + mult, 0.3 - (i - 0.15) / 99, 0.6)
- w[i - 1] = Instance.new("Weld", Parts[i])
- w[i - 1].Part0 = Parts[i - 1]
- w[i - 1].Part1 = Parts[i]
- w[i - 1].C0 = CFrame.new(0, 0, 0.69)
- w[i - 1].C1 = CFrame.new(0, 0, -0.69)
- end
- w[1].C0 = CFrame.new(0, -0.35, 0)
- function Smooth(WhereTo0, Welds)
- local CR0 = CFrame.new(Welds[1].C1:toEulerAnglesXYZ()).p
- local CR1 = CFrame.new(WhereTo0).p
- local AddTo0 = (CR1 - CR0) / 6.9
- for a = 1, #Welds do
- Welds[a].C1 = Welds[a].C1 * CFrame.fromEulerAnglesXYZ(AddTo0.x, AddTo0.y, AddTo0.z)
- end
- end
- local scr = Instance.new("ScreenGui", owner.PlayerGui)
- local absx = scr.AbsoluteSize.X
- local absy = scr.AbsoluteSize.Y
- scr:Destroy()
- local mouse = owner:GetMouse()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement