SHOW:
|
|
- or go back to the newest paste.
1 | -- This script has been converted to FE by iPxter | |
2 | ||
3 | - | plr = game:service'Players'.LocalPlayer |
3 | + | |
4 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
5 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
6 | do | |
7 | - | mouse = plr:GetMouse() |
7 | + | print("FE Compatibility code by Mokiros | Translated to FE by iPxter") |
8 | script.Parent = Player.Character | |
9 | ||
10 | --RemoteEvent for communicating | |
11 | local Event = Instance.new("RemoteEvent") | |
12 | Event.Name = "UserInput_Event" | |
13 | ||
14 | --Fake event to make stuff like Mouse.KeyDown work | |
15 | local function fakeEvent() | |
16 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} | |
17 | t.connect = t.Connect | |
18 | return t | |
19 | end | |
20 | ||
21 | --Creating fake input objects with fake variables | |
22 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
23 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
24 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
25 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
26 | end} | |
27 | --Merged 2 functions into one by checking amount of arguments | |
28 | CAS.UnbindAction = CAS.BindAction | |
29 | ||
30 | --This function will trigger the events that have been :Connect()'ed | |
31 | local function te(self,ev,...) | |
32 | local t = m[ev] | |
33 | if t and t._fakeEvent and t.Function then | |
34 | t.Function(...) | |
35 | end | |
36 | end | |
37 | m.TrigEvent = te | |
38 | UIS.TrigEvent = te | |
39 | ||
40 | Event.OnServerEvent:Connect(function(plr,io) | |
41 | if plr~=Player then return end | |
42 | if io.isMouse then | |
43 | m.Target = io.Target | |
44 | m.Hit = io.Hit | |
45 | else | |
46 | local b = io.UserInputState == Enum.UserInputState.Begin | |
47 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
48 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
49 | end | |
50 | for _,t in pairs(CAS.Actions) do | |
51 | for _,k in pairs(t.Keys) do | |
52 | if k==io.KeyCode then | |
53 | t.Function(t.Name,io.UserInputState,io) | |
54 | end | |
55 | end | |
56 | end | |
57 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
58 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
59 | end | |
60 | end) | |
61 | Event.Parent = NLS([==[ | |
62 | local Player = game:GetService("Players").LocalPlayer | |
63 | local Event = script:WaitForChild("UserInput_Event") | |
64 | ||
65 | local UIS = game:GetService("UserInputService") | |
66 | local input = function(io,a) | |
67 | if a then return end | |
68 | --Since InputObject is a client-side instance, we create and pass table instead | |
69 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) | |
70 | end | |
71 | UIS.InputBegan:Connect(input) | |
72 | UIS.InputEnded:Connect(input) | |
73 | ||
74 | local Mouse = Player:GetMouse() | |
75 | local h,t | |
76 | --Give the server mouse data 30 times every second, but only if the values changed | |
77 | --If player is not moving their mouse, client won't fire events | |
78 | while wait(1/30) do | |
79 | if h~=Mouse.Hit or t~=Mouse.Target then | |
80 | h,t=Mouse.Hit,Mouse.Target | |
81 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
82 | end | |
83 | end]==],Player.Character) | |
84 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
85 | end | |
86 | ||
87 | wait(1/60) | |
88 | ||
89 | plr = owner | |
90 | char = plr.Character | |
91 | root = char:FindFirstChild'HumanoidRootPart' | |
92 | hum = char:FindFirstChildOfClass'Humanoid' | |
93 | clones = {} | |
94 | followplr = true | |
95 | radius = 25 | |
96 | ||
97 | if char.Head:FindFirstChild'face' then | |
98 | char.Head.face:Destroy() | |
99 | end | |
100 | ||
101 | for _, a in pairs(char:children()) do | |
102 | if a:IsA'Part' then | |
103 | a.Transparency = 1 | |
104 | elseif a:IsA'Accessory' then | |
105 | a:Destroy() | |
106 | end | |
107 | end | |
108 | ||
109 | eyes = Instance.new('Part', char) | |
110 | eyes.Anchored = false | |
111 | eyes.Name = "Eyes" | |
112 | eyes.Size = Vector3.new(0.22, 0.052, 0.105) | |
113 | eyesm = Instance.new('SpecialMesh', eyes) | |
114 | eyesm.Scale = Vector3.new(0.039, 0.039, 0.039) | |
115 | eyesm.MeshId = "rbxassetid://1300138314" | |
116 | eyesm.TextureId = "rbxassetid://1300129774" | |
117 | ||
118 | body = Instance.new('Part', char) | |
119 | body.Anchored = false | |
120 | body.Name = "Body" | |
121 | body.Size = Vector3.new(0.07, 0.062, 0.078) | |
122 | bodym = Instance.new('SpecialMesh', body) | |
123 | bodym.Scale = Vector3.new(0.039, 0.039, 0.039) | |
124 | bodym.MeshId = "rbxassetid://1300136843" | |
125 | bodym.TextureId = "rbxassetid://1300137893" | |
126 | ||
127 | weld1 = Instance.new('Weld', eyes) | |
128 | weld1.Part0 = eyes | |
129 | weld1.Part1 = root | |
130 | weld1.C0 = CFrame.new(0,1.55,.2) | |
131 | weld2 = Instance.new('Weld', body) | |
132 | weld2.Part0 = body | |
133 | weld2.Part1 = root | |
134 | weld2.C0 = CFrame.new(0,2.1,0) | |
135 | local music=Instance.new("Sound",char.Torso) | |
136 | music.SoundId="rbxassetid://1319438783" | |
137 | music.Volume = 2.5 | |
138 | music.Looped=true | |
139 | music:Play() | |
140 | TheWay1 = Instance.new('Sound', body) | |
141 | TheWay1.SoundId = "rbxassetid://1320393438" | |
142 | TheWay1.Volume = 3 | |
143 | TheWay1.Name = "TheWay1" | |
144 | TheWay2 = Instance.new('Sound', body) | |
145 | TheWay2.SoundId = "rbxassetid://1295525558" | |
146 | TheWay2.Volume = 3 | |
147 | TheWay2.Name = "TheWay2" | |
148 | Spit = Instance.new('Sound', body) | |
149 | Spit.SoundId = "rbxassetid://1322795266" | |
150 | Spit.Volume = 3 | |
151 | Spit.Name = "Spit" | |
152 | Click = Instance.new('Sound', body) | |
153 | Click.SoundId = "rbxassetid://1335379417" | |
154 | Click.Volume = 3 | |
155 | ||
156 | num = 1 | |
157 | cooldown = false | |
158 | rand = math.random(1,2) | |
159 | ||
160 | for i = 1,10 do | |
161 | wait() | |
162 | char.Archivable = true | |
163 | clone = char:Clone() | |
164 | for _, a in pairs(clone:children()) do | |
165 | if a.Name == "Right Arm" or a.Name == "UpperRightArm" then | |
166 | a:Destroy() | |
167 | elseif a.Name == 'Left Arm' or a.Name == 'UpperLeftArm' then | |
168 | a:Destroy() | |
169 | elseif a.Name == "Torso" or a.Name == "UpperTorso" then | |
170 | if a.Sound then | |
171 | a.Sound:Remove() | |
172 | end | |
173 | end | |
174 | end | |
175 | table.insert(clones,clone) | |
176 | end | |
177 | ||
178 | for _, a in pairs(clones) do | |
179 | a.Parent = char | |
180 | a:MoveTo(root.Position + Vector3.new(math.random(1,10),math.random(1,10),math.random(1,10))) | |
181 | end | |
182 | ||
183 | function sfx1() | |
184 | for _, a in pairs(clones) do | |
185 | rand = math.random(1,2) | |
186 | if rand == 1 then | |
187 | a.Body['TheWay1'].Pitch = math.random(0.9,1) | |
188 | a.Body['TheWay1']:Play() | |
189 | elseif rand == 2 then | |
190 | a.Body['TheWay2'].Pitch = math.random(0.9,1) | |
191 | a.Body['TheWay2']:Play() | |
192 | end | |
193 | wait(math.random(0.4,0.6)) | |
194 | end | |
195 | end | |
196 | ||
197 | function sfx2() | |
198 | for _, a in pairs(clones) do | |
199 | a.Body.Spit.Pitch = math.random(0.9,1) | |
200 | a.Body.Spit:Play() | |
201 | wait(math.random(0.4,0.6)) | |
202 | end | |
203 | end | |
204 | ||
205 | mouse.KeyDown:connect(function(k) | |
206 | key = k:lower() | |
207 | if key == "e" and not cooldown then | |
208 | cooldown = true | |
209 | sfx1() | |
210 | wait(.7) | |
211 | cooldown = false | |
212 | elseif key == "r" and not cooldown then | |
213 | cooldown = true | |
214 | sfx2() | |
215 | wait(.7) | |
216 | cooldown = false | |
217 | end | |
218 | end) | |
219 | ||
220 | plr.Chatted:connect(function(m) | |
221 | if string.sub(m:lower(),1,15) == "bruddas, follow" then | |
222 | for _,v in pairs(game:service'Players':GetPlayers()) do | |
223 | if string.find(v.Name:lower(),string.sub(m:lower(),17,-1)) then | |
224 | stalking = v | |
225 | else | |
226 | stalking = plr | |
227 | end | |
228 | end | |
229 | elseif string.sub(m:lower(),1,16) == "bruddas, protect" then | |
230 | for _,v in pairs(game:service'Players':GetPlayers()) do | |
231 | if string.find(v.Name:lower(),string.sub(m:lower(),18,-1)) then | |
232 | protecting = v | |
233 | else | |
234 | protecting = nil | |
235 | end | |
236 | end | |
237 | end | |
238 | end) | |
239 | ||
240 | while wait(1) do | |
241 | number = #clones | |
242 | position = root.CFrame | |
243 | protecting = false | |
244 | if stalking == nil then | |
245 | followplr = true | |
246 | elseif stalking ~= nil then | |
247 | followplr = false | |
248 | end | |
249 | for _, a in pairs(clones) do | |
250 | if a:FindFirstChildOfClass'Humanoid' and followplr and not protecting then | |
251 | a:FindFirstChildOfClass'Humanoid':MoveTo(root.Position + Vector3.new(math.random(-10,10),0,math.random(-10,10))) | |
252 | end | |
253 | end | |
254 | if not protecting and not followplr and stalking ~= nil and stalking.Character:FindFirstChild'HumanoidRootPart' then | |
255 | for _, a in pairs(clones) do | |
256 | if a:FindFirstChildOfClass'Humanoid' then | |
257 | a:FindFirstChildOfClass'Humanoid':MoveTo(stalking.Character.HumanoidRootPart.Position + Vector3.new(math.random(-10,10),0,math.random(-10,10))) | |
258 | end | |
259 | end | |
260 | rand = math.random(1,10) | |
261 | if rand == 5 then | |
262 | for i = 1,3 do | |
263 | random = clones[math.random(1,#clones)] | |
264 | rand = math.random(1,2) | |
265 | if rand == 1 then | |
266 | random.Body['TheWay1']:Play() | |
267 | else | |
268 | random.Body['TheWay2']:Play() | |
269 | end | |
270 | end | |
271 | end | |
272 | end | |
273 | end |