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