SHOW:
|
|
- or go back to the newest paste.
1 | - | local plr = game:GetService("Players").LocalPlayer |
1 | + | --https://github.com/Mokiros/roblox-FE-compatibility |
2 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
3 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
4 | local RealPlayer = Player | |
5 | 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 local plr = game:GetService("Players").LocalPlayer | |
6 | local char = plr.Character | |
7 | local hum = char:FindFirstChildOfClass("Humanoid") | |
8 | local mou = plr:GetMouse() | |
9 | local tor = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso") | |
10 | local head = char:FindFirstChild("Head") | |
11 | local face = head:FindFirstChildOfClass("Decal") | |
12 | local neck = tor:FindFirstChild("Neck") | |
13 | local larm = char:FindFirstChild("Left Arm") or char:FindFirstChild("LeftUpperArm") | |
14 | local rarm = char:FindFirstChild("Right Arm") or char:FindFirstChild("RightUpperArm") | |
15 | local rleg = char:FindFirstChild("Right Leg") or char:FindFirstChild("RightUpperLeg") | |
16 | local lleg = char:FindFirstChild("Left Leg") or char:FindFirstChild("LeftUpperLeg") | |
17 | local ls = tor:FindFirstChild("Left Shoulder") | |
18 | local rs = tor:FindFirstChild("Right Shoulder") | |
19 | local punching = false | |
20 | local attack = false | |
21 | local out = false | |
22 | ||
23 | ||
24 | ||
25 | char.Archivable = true | |
26 | local Schar = char:Clone() | |
27 | local Slarm = Schar:FindFirstChild("Left Arm") | |
28 | local Srarm = Schar:FindFirstChild("Right Arm") | |
29 | Schar.Parent = char | |
30 | Schar:MoveTo(tor.Position + Vector3.new(0, -5, 0)) | |
31 | Schar.Name = char.Name.."'s (crappy) Stand" | |
32 | local Shum = Schar:FindFirstChildOfClass("Humanoid") | |
33 | local Stor = Schar:FindFirstChild("Torso") or Schar:FindFirstChild("UpperTorso") | |
34 | Stor.Anchored = true | |
35 | local Shead = Schar:FindFirstChild("Head") | |
36 | local Sface = Shead:FindFirstChildOfClass("Decal") | |
37 | Sface:Destroy() | |
38 | local Sls = Stor:FindFirstChild("Left Shoulder") | |
39 | local Srs = Stor:FindFirstChild("Right Shoulder") | |
40 | local Slleg = Schar:FindFirstChild("Left Leg") | |
41 | local Srleg = Schar:FindFirstChild("Right Leg") | |
42 | local Slsstart = Sls.C1 | |
43 | local Srsstart = Srs.C1 | |
44 | local Slsstart2 = Sls.C1 * CFrame.Angles(0, 0, math.rad(90)) | |
45 | local Srsstart2 = Srs.C1 * CFrame.Angles(0, 0, math.rad(-90)) | |
46 | local finish = tor.CFrame * CFrame.new(0, 1.5, 3) | |
47 | local finish2 = tor.CFrame * CFrame.new(0, 2, 3) | |
48 | local Slsfinish = Sls.C1 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, math.rad(0)) | |
49 | local Slsfinish2 = Sls.C1 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, math.rad(0)) | |
50 | local Srsfinish = Srs.C1 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, math.rad(0)) | |
51 | local Srsfinish2 = Srs.C1 * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, math.rad(0)) | |
52 | Shead.CanCollide = false | |
53 | Stor.CanCollide = false | |
54 | Slarm.CanCollide = false | |
55 | Srarm.CanCollide = false | |
56 | char.Archivable = false | |
57 | for i,v in pairs(Schar:GetChildren()) do | |
58 | if v:IsA("Part") then | |
59 | v.Transparency = 0.5 | |
60 | v.Material = "Neon" | |
61 | v.CanCollide = false | |
62 | end | |
63 | if v:IsA("Accessory") then | |
64 | v.Handle.Anchored = false | |
65 | end | |
66 | end | |
67 | ||
68 | ||
69 | function down(key) | |
70 | if key == "e" then | |
71 | punching = true | |
72 | wait() | |
73 | Sls.C1 = Slsstart2 | |
74 | Srs.C1 = Srsstart2 | |
75 | local aSlsstart = Sls.C1 | |
76 | local aSrsstart = Srs.C1 | |
77 | while punching == true do | |
78 | local hit1 = Slarm:GetConnectedParts() | |
79 | if hit1.Parent and hit1.Parent.Name ~= char.Name and hit1.Parent:FindFirstChildOfClass("Humanoid") then | |
80 | local owhum = hit1.Parent:FindFirstChild("Humanoid") | |
81 | owhum.Health = owhum.Health - 10 | |
82 | end | |
83 | local hit2 = Slarm:GetConnectedParts() | |
84 | if hit2.Parent and hit2.Parent.Name ~= char.Name and hit2.Parent:FindFirstChildOfClass("Humanoid") then | |
85 | local owhum2 = hit2.Parent:FindFirstChild("Humanoid") | |
86 | owhum2.Health = owhum2.Health - 10 | |
87 | end | |
88 | wait() | |
89 | attack = true | |
90 | finish2 = tor.CFrame * CFrame.new(0, 0.5, -4) | |
91 | finish = tor.CFrame * CFrame.new(0, 0.5, -4) | |
92 | Sls.C1 = aSlsstart * CFrame.new(1, 0, 0) | |
93 | Srs.C1 = aSrsstart | |
94 | wait() | |
95 | Sls.C1 = aSlsstart | |
96 | Srs.C1 = aSrsstart * CFrame.new(-1, 0, 0) | |
97 | wait() | |
98 | end | |
99 | wait() | |
100 | end | |
101 | end | |
102 | ||
103 | function up(key) | |
104 | if key == "e" then | |
105 | punching = false | |
106 | wait() | |
107 | while punching == false do | |
108 | wait() | |
109 | attack = false | |
110 | Sls.C1 = Slsstart | |
111 | Srs.C1 = Srsstart | |
112 | Slsfinish = Slsstart | |
113 | Slsfinish2 = Slsstart | |
114 | Srsfinish = Srsstart | |
115 | Srsfinish2 = Srsstart | |
116 | finish2 = tor.CFrame * CFrame.new(0, 2.5, 3) | |
117 | finish = tor.CFrame * CFrame.new(0, 2.5, 3) | |
118 | end | |
119 | wait() | |
120 | end | |
121 | end | |
122 | ||
123 | mou.KeyDown:connect(down) | |
124 | mou.KeyUp:connect(up) | |
125 | ||
126 | while true do | |
127 | wait() | |
128 | for i = 0,1,.1 do | |
129 | local start = Stor.CFrame | |
130 | Stor.CFrame = start:lerp(finish, i) | |
131 | wait() | |
132 | end | |
133 | for i = 0,1,.1 do | |
134 | local start = Stor.CFrame | |
135 | Stor.CFrame = start:lerp(finish2, i) | |
136 | wait() | |
137 | end | |
138 | wait() | |
139 | end |