SHOW:
|
|
- or go back to the newest paste.
1 | //-- | |
2 | ||
3 | -- This script has been converted to FE by iPxter | |
4 | ||
5 | ||
6 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
7 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
8 | do | |
9 | print("FE Compatibility code by Mokiros | Translated to FE by iPxter") | |
10 | script.Parent = Player.Character | |
11 | ||
12 | --RemoteEvent for communicating | |
13 | local Event = Instance.new("RemoteEvent") | |
14 | Event.Name = "UserInput_Event" | |
15 | ||
16 | --Fake event to make stuff like Mouse.KeyDown work | |
17 | local function fakeEvent() | |
18 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} | |
19 | t.connect = t.Connect | |
20 | return t | |
21 | end | |
22 | ||
23 | --Creating fake input objects with fake variables | |
24 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
25 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
26 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
27 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
28 | end} | |
29 | --Merged 2 functions into one by checking amount of arguments | |
30 | CAS.UnbindAction = CAS.BindAction | |
31 | ||
32 | --This function will trigger the events that have been :Connect()'ed | |
33 | local function te(self,ev,...) | |
34 | local t = m[ev] | |
35 | if t and t._fakeEvent and t.Function then | |
36 | t.Function(...) | |
37 | end | |
38 | end | |
39 | m.TrigEvent = te | |
40 | UIS.TrigEvent = te | |
41 | ||
42 | Event.OnServerEvent:Connect(function(plr,io) | |
43 | if plr~=Player then return end | |
44 | if io.isMouse then | |
45 | m.Target = io.Target | |
46 | m.Hit = io.Hit | |
47 | else | |
48 | local b = io.UserInputState == Enum.UserInputState.Begin | |
49 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
50 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
51 | end | |
52 | for _,t in pairs(CAS.Actions) do | |
53 | for _,k in pairs(t.Keys) do | |
54 | if k==io.KeyCode then | |
55 | t.Function(t.Name,io.UserInputState,io) | |
56 | end | |
57 | end | |
58 | end | |
59 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
60 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
61 | end | |
62 | end) | |
63 | Event.Parent = NLS([==[ | |
64 | local Player = game:GetService("Players").LocalPlayer | |
65 | local Event = script:WaitForChild("UserInput_Event") | |
66 | ||
67 | local UIS = game:GetService("UserInputService") | |
68 | local input = function(io,a) | |
69 | if a then return end | |
70 | --Since InputObject is a client-side instance, we create and pass table instead | |
71 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) | |
72 | end | |
73 | UIS.InputBegan:Connect(input) | |
74 | UIS.InputEnded:Connect(input) | |
75 | ||
76 | local Mouse = Player:GetMouse() | |
77 | local h,t | |
78 | --Give the server mouse data 30 times every second, but only if the values changed | |
79 | --If player is not moving their mouse, client won't fire events | |
80 | while wait(1/30) do | |
81 | if h~=Mouse.Hit or t~=Mouse.Target then | |
82 | h,t=Mouse.Hit,Mouse.Target | |
83 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
84 | end | |
85 | end]==],Player.Character) | |
86 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
87 | end | |
88 | ||
89 | wait(0.2) | |
90 | ||
91 | -- This script has been converted to FE by iPxter | |
92 | ||
93 | local p = game.Players.LocalPlayer | |
94 | local char = p.Character | |
95 | local size = 8 | |
96 | part = function() | |
97 | ||
98 | local a = Instance.new("Part", script) | |
99 | a.Anchored = true | |
100 | a.CanCollide = true | |
101 | a.CFrame = char.Torso.CFrame | |
102 | a.Size = Vector3.new(size, 0.2, 0.2) | |
103 | a.Transparency = 1 | |
104 | return a | |
105 | end | |
106 | ||
107 | part2 = function() | |
108 | ||
109 | local a = Instance.new("Part", script) | |
110 | a.Anchored = true | |
111 | a.CanCollide = true | |
112 | a.CFrame = char.Torso.CFrame | |
113 | a.Size = Vector3.new(0.2, size, 0.2) | |
114 | a.Transparency = 1 | |
115 | return a | |
116 | end | |
117 | ||
118 | part3 = function() | |
119 | ||
120 | local a = Instance.new("Part", script) | |
121 | a.Anchored = true | |
122 | a.CanCollide = false | |
123 | a.Size = Vector3.new(size, size, 1) | |
124 | a.Transparency = 0.7 | |
125 | a.Material = "Neon" | |
126 | a.BrickColor = BrickColor.new("Really red") | |
127 | local b = Instance.new("BlockMesh", a) | |
128 | b.Scale = Vector3.new(1, 1, 0) | |
129 | return a | |
130 | end | |
131 | ||
132 | local replicating = false | |
133 | local root, a, b, c, d, a2, b2, c2, d2, aa, bb, cc, dd, z, x, c, v, b, n = nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil | |
134 | replicate = function() | |
135 | ||
136 | replicating = true | |
137 | script:ClearAllChildren() | |
138 | root = part() | |
139 | root.Transparency = 1 | |
140 | root.Size = Vector3.new(0.2, 0.2, 0.2) | |
141 | root.CanCollide = false | |
142 | a = part() | |
143 | b = part() | |
144 | c = part() | |
145 | d = part() | |
146 | a2 = part() | |
147 | b2 = part() | |
148 | c2 = part() | |
149 | d2 = part() | |
150 | aa = part2() | |
151 | bb = part2() | |
152 | cc = part2() | |
153 | dd = part2() | |
154 | z = part3() | |
155 | x = part3() | |
156 | c = part3() | |
157 | v = part3() | |
158 | b = part3() | |
159 | n = part3() | |
160 | replicating = false | |
161 | end | |
162 | ||
163 | script.ChildRemoved:connect(function(a) | |
164 | ||
165 | if a.ClassName == "Part" and replicating == false then | |
166 | replicate() | |
167 | end | |
168 | end | |
169 | ) | |
170 | replicate() | |
171 | local tick = 0 | |
172 | CreateRegion3FromLocAndSize = function(Position, Size) | |
173 | ||
174 | local SizeOffset = Size / 2 | |
175 | local Point1 = Position - SizeOffset | |
176 | local Point2 = Position + SizeOffset | |
177 | return Region3.new(Point1, Point2) | |
178 | end | |
179 | ||
180 | local set = false | |
181 | local whitelist = {"Hieroku", "PPATTA", "DevGamerzz", "I kill U", "kash5", "ZeroCrimson", "Zaidia", "tsup2", "PointCoded", "CLarramore", "Suzuuki", "", "", ""} | |
182 | p.Chatted:connect(function(ms) | |
183 | ||
184 | if ms:sub(1, 5) == "size-" then | |
185 | size = tonumber(ms:sub(6)) | |
186 | replicate() | |
187 | else | |
188 | if ms:sub(1, 4) == "set-" then | |
189 | set = true | |
190 | z.CanCollide = false | |
191 | x.CanCollide = false | |
192 | c.CanCollide = false | |
193 | v.CanCollide = false | |
194 | b.CanCollide = false | |
195 | n.CanCollide = false | |
196 | else | |
197 | if ms:sub(1, 6) == "unset-" then | |
198 | set = false | |
199 | z.CanCollide = false | |
200 | x.CanCollide = false | |
201 | c.CanCollide = false | |
202 | v.CanCollide = false | |
203 | b.CanCollide = false | |
204 | n.CanCollide = false | |
205 | else | |
206 | if ms:sub(1, 10) == "whitelist-" then | |
207 | table.insert(whitelist, ms:sub(11)) | |
208 | else | |
209 | if ms:sub(1, 12) == "unwhitelist-" then | |
210 | for i,v in pairs(whitelist) do | |
211 | if ms:sub(13) == v then | |
212 | table.remove(whitelist, i) | |
213 | break | |
214 | end | |
215 | end | |
216 | end | |
217 | end | |
218 | end | |
219 | end | |
220 | end | |
221 | end | |
222 | ) | |
223 | local magicpos = nil | |
224 | game:GetService("RunService").Heartbeat:connect(function() | |
225 | ||
226 | pcall(function() | |
227 | ||
228 | local void = char:GetChildren() | |
229 | for _,pl in pairs(whitelist) do | |
230 | if game.Players:FindFirstChild(pl) ~= nil and game.Players:FindFirstChild(pl).Character ~= nil then | |
231 | for i,v in pairs(game.Players[pl].Character:GetChildren()) do | |
232 | table.insert(void, v) | |
233 | end | |
234 | end | |
235 | end | |
236 | for i,v in pairs(game.Players:GetPlayers()) do | |
237 | if v.Character:isDescendantOf(char) and not v.Name == "FangxWulf" then | |
238 | v:LoadCharacter() | |
239 | end | |
240 | end | |
241 | char.Humanoid.Health = math.huge | |
242 | tick = tick + 0.01 | |
243 | if not set then | |
244 | root.CFrame = root.CFrame:lerp(CFrame.new(char.Torso.CFrame.p) * CFrame.Angles(math.sin(tick) * 100 / 30 / (size / 2), math.cos(tick) * 100 / 30 / (size / 2), math.cos(tick) * 100 / 30 / (size / 2)), 0.1) | |
245 | magicpos = char.Torso.CFrame | |
246 | else | |
247 | root.CFrame = root.CFrame:lerp(CFrame.new(magicpos.p) * CFrame.Angles(0, 0, 0), 0.05) | |
248 | end | |
249 | local reg = CreateRegion3FromLocAndSize(root.CFrame.p, Vector3.new(size, size, size)) | |
250 | for i,v in pairs(game.Workspace:FindPartsInRegion3WithIgnoreList(reg, void, 100)) do | |
251 | if v.Name ~= "Base" then | |
252 | v:Destroy() | |
253 | end | |
254 | end | |
255 | a.CFrame = root.CFrame * CFrame.new(size / 2, size / 2, 0) * CFrame.Angles(0, math.rad(90), 0) | |
256 | b.CFrame = root.CFrame * CFrame.new(-size / 2, size / 2, 0) * CFrame.Angles(0, math.rad(90), 0) | |
257 | c.CFrame = root.CFrame * CFrame.new(0, size / 2, size / 2) | |
258 | d.CFrame = root.CFrame * CFrame.new(0, size / 2, -size / 2) | |
259 | a2.CFrame = root.CFrame * CFrame.new(size / 2, -size / 2, 0) * CFrame.Angles(0, math.rad(90), 0) | |
260 | b2.CFrame = root.CFrame * CFrame.new(-size / 2, -size / 2, 0) * CFrame.Angles(0, math.rad(90), 0) | |
261 | c2.CFrame = root.CFrame * CFrame.new(0, -size / 2, size / 2) | |
262 | d2.CFrame = root.CFrame * CFrame.new(0, -size / 2, -size / 2) | |
263 | aa.CFrame = root.CFrame * CFrame.new(size / 2, 0, size / 2) | |
264 | bb.CFrame = root.CFrame * CFrame.new(-size / 2, 0, size / 2) | |
265 | cc.CFrame = root.CFrame * CFrame.new(-size / 2, 0, -size / 2) | |
266 | dd.CFrame = root.CFrame * CFrame.new(size / 2, 0, -size / 2) | |
267 | z.CFrame = root.CFrame * CFrame.new(size / 2, 0, 0) * CFrame.Angles(0, math.rad(90), 0) | |
268 | x.CFrame = root.CFrame * CFrame.new(-size / 2, 0, 0) * CFrame.Angles(0, math.rad(90), 0) | |
269 | c.CFrame = root.CFrame * CFrame.new(0, 0, size / 2) * CFrame.Angles(0, 0, math.rad(90)) | |
270 | v.CFrame = root.CFrame * CFrame.new(0, 0, -size / 2) * CFrame.Angles(0, 0, math.rad(90)) | |
271 | b.CFrame = root.CFrame * CFrame.new(0, size / 2, 0) * CFrame.Angles(math.rad(90), 0, 0) | |
272 | n.CFrame = root.CFrame * CFrame.new(0, -size / 2, 0) * CFrame.Angles(math.rad(90), 0, 0) | |
273 | end | |
274 | ) | |
275 | end | |
276 | ) |