SHOW:
|
|
- or go back to the newest paste.
1 | -- This script has been converted to FE by iPxter | |
2 | ||
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 | 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 | local admins = { | |
87 | ["Hatuey_Yael"] = 'Admin'; | |
88 | ["TameDoNotClick"] = 'Admin'; | |
89 | ["AltSkittles"] = 'Admin'; | |
90 | ["Dem_SkittlesDo"] = 'Admin'; | |
91 | ["unknown"] = 'Admin'; | |
92 | ["Player1"] = 'Admin'; | |
93 | ["saltnvinigerchips"] = 'Admin'; | |
94 | } | |
95 | local part = Instance.new("Part") | |
96 | local mesh = Instance.new("SpecialMesh") | |
97 | local weld = Instance.new("Weld") | |
98 | local sound = Instance.new("Sound") | |
99 | ||
100 | part.Parent = owner.Character.Head | |
101 | part.Size = Vector3.new(3.237, 1.909, 1.506) | |
102 | ||
103 | sound.Parent = part | |
104 | - | sound.SoundId = "rbxassetid://2778425335" |
104 | + | sound.SoundId = "rbxassetid://0" |
105 | sound.MaxDistance = 1000 | |
106 | sound.Volume = 100 | |
107 | sound.Looped = true | |
108 | sound.PlaybackSpeed = 1 | |
109 | sound:Play() | |
110 | ||
111 | ||
112 | for i,v in pairs(game.Players:GetPlayers()) do | |
113 | if admins[v.Name] then | |
114 | print("An admin is in the server") | |
115 | owner.Chatted:connect(function(msg) | |
116 | if msg:sub(1,5) == "play " or msg:sub(1,5) == "Play " then | |
117 | sound:Stop() | |
118 | sound.SoundId = "rbxassetid://" ..msg:sub(6) | |
119 | sound:Play() | |
120 | elseif msg:sub(1,6) == "pitch " or msg:sub(1,6) == "Pitch " then | |
121 | sound.PlaybackSpeed = msg:sub(7) | |
122 | elseif msg:sub(1,7) == "volume " or msg:sub(1,7) == "Volume " then | |
123 | sound.Volume = msg:sub(8) | |
124 | elseif msg:sub(1,9) == "distance " or msg:sub(1,9) == "Distance " then | |
125 | sound.MaxDistance = msg:sub(10) | |
126 | end | |
127 | ||
128 | end) | |
129 | end | |
130 | end | |
131 | ||
132 | mesh.Parent = part | |
133 | mesh.MeshId = "rbxassetid://2511970016" | |
134 | mesh.TextureId = "rbxassetid://2511970101" | |
135 | ||
136 | weld.Parent = owner.Character.Head | |
137 | weld.Part0 = part | |
138 | weld.Part1 = owner.Character.Head | |
139 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 3.2, 0) | |
140 | weld.C0 = CFrame.new(2, 0, 5) | |
141 | while true do | |
142 | wait() | |
143 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 1, 0) | |
144 | wait() | |
145 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 1.1, 0) | |
146 | wait() | |
147 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 1.2, 0) | |
148 | wait() | |
149 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 1.3, 0) | |
150 | wait() | |
151 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 1.4, 0) | |
152 | wait() | |
153 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 1.5, 0) | |
154 | wait() | |
155 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 1.6, 0) | |
156 | wait() | |
157 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 1.7, 0) | |
158 | wait() | |
159 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 1.8, 0) | |
160 | wait() | |
161 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 1.9, 0) | |
162 | wait() | |
163 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 2, 0) | |
164 | wait() | |
165 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 2.1, 0) | |
166 | wait() | |
167 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 2.2, 0) | |
168 | wait() | |
169 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 2.3, 0) | |
170 | wait() | |
171 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 2.4, 0) | |
172 | wait() | |
173 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 2.5, 0) | |
174 | wait() | |
175 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 2.6, 0) | |
176 | wait() | |
177 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 2.7, 0) | |
178 | wait() | |
179 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 2.8, 0) | |
180 | wait() | |
181 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 2.9, 0) | |
182 | wait() | |
183 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 3, 0) | |
184 | wait() | |
185 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 3.1, 0) | |
186 | wait() | |
187 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 3.2, 0) | |
188 | wait() | |
189 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 3.3, 0) | |
190 | wait() | |
191 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 3.4, 0) | |
192 | wait() | |
193 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 3.5, 0) | |
194 | wait() | |
195 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 3.6, 0) | |
196 | wait() | |
197 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 3.7, 0) | |
198 | wait() | |
199 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 3.8, 0) | |
200 | wait() | |
201 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 3.9, 0) | |
202 | wait() | |
203 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 4, 0) | |
204 | wait() | |
205 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 4.1, 0) | |
206 | wait() | |
207 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 4.2, 0) | |
208 | wait() | |
209 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 4.3, 0) | |
210 | wait() | |
211 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 4.4, 0) | |
212 | wait() | |
213 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 4.5, 0) | |
214 | wait() | |
215 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 4.6, 0) | |
216 | wait() | |
217 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 4.7, 0) | |
218 | wait() | |
219 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 4.8, 0) | |
220 | wait() | |
221 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 4.9, 0) | |
222 | wait() | |
223 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 5, 0) | |
224 | wait() | |
225 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 5.1, 0) | |
226 | wait() | |
227 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 5.2, 0) | |
228 | wait() | |
229 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 5.3, 0) | |
230 | wait() | |
231 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 5.4, 0) | |
232 | wait() | |
233 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 5.5, 0) | |
234 | wait() | |
235 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 5.6, 0) | |
236 | wait() | |
237 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 5.7, 0) | |
238 | wait() | |
239 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 5.8, 0) | |
240 | wait() | |
241 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 5.9, 0) | |
242 | wait() | |
243 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 6, 0) | |
244 | wait() | |
245 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 6.1, 0) | |
246 | wait() | |
247 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 6.2, 0) | |
248 | wait() | |
249 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 6.3, 0) | |
250 | wait() | |
251 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 6.4, 0) | |
252 | wait() | |
253 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 6.5, 0) | |
254 | wait() | |
255 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 6.6, 0) | |
256 | wait() | |
257 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 6.7, 0) | |
258 | wait() | |
259 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 6.8, 0) | |
260 | wait() | |
261 | weld.C1 = CFrame.fromEulerAnglesXYZ(0, 6.9, 0) | |
262 | wait() | |
263 | end |