View difference between Paste ID: n54yU4SH and NNp1NJKT
SHOW: | | - or go back to the newest paste.
1
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
2
local Player,game,owner = owner,game
3
local RealPlayer = Player
4
do
5
	print("FE Compatibility code by Mokiros")
6
	local rp = RealPlayer
7
	script.Parent = rp.Character
8
	
9
	--RemoteEvent for communicating
10
	local Event = Instance.new("RemoteEvent")
11
	Event.Name = "UserInput_Event"
12
13
	--Fake event to make stuff like Mouse.KeyDown work
14
	local function fakeEvent()
15
		local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
16
		t.connect = t.Connect
17
		return t
18
	end
19
20
	--Creating fake input objects with fake variables
21
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
22
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
23
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
24
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
25
	end}
26
	--Merged 2 functions into one by checking amount of arguments
27
	CAS.UnbindAction = CAS.BindAction
28
29
	--This function will trigger the events that have been :Connect()'ed
30
	local function te(self,ev,...)
31
		local t = m[ev]
32
		if t and t._fakeEvent then
33
			for _,f in pairs(t.Functions) do
34
				f(...)
35
			end
36
		end
37
	end
38
	m.TrigEvent = te
39
	UIS.TrigEvent = te
40
41
	Event.OnServerEvent:Connect(function(plr,io)
42
	    if plr~=rp then return end
43
		m.Target = io.Target
44
		m.Hit = io.Hit
45
		if not io.isMouse then
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 Mouse = Player:GetMouse()
66
	local UIS = game:GetService("UserInputService")
67
	local input = function(io,a)
68
		if a then return end
69
		--Since InputObject is a client-side instance, we create and pass table instead
70
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
71
	end
72
	UIS.InputBegan:Connect(input)
73
	UIS.InputEnded:Connect(input)
74
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
85
	----Sandboxed game object that allows the usage of client-side methods and services
86
	--Real game object
87
	local _rg = game
88
89
	--Metatable for fake service
90
	local fsmt = {
91
		__index = function(self,k)
92
			local s = rawget(self,"_RealService")
93
			if s then return s[k] end
94
		end,
95
		__newindex = function(self,k,v)
96
			local s = rawget(self,"_RealService")
97
			if s then s[k]=v end
98
		end,
99
		__call = function(self,...)
100
			local s = rawget(self,"_RealService")
101
			if s then return s(...) end
102
		end
103
	}
104
	local function FakeService(t,RealService)
105
		t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
106
		return setmetatable(t,fsmt)
107
	end
108
109
	--Fake game object
110
	local g = {
111
		GetService = function(self,s)
112
			return self[s]
113
		end,
114
		Players = FakeService({
115
			LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
116
		},"Players"),
117
		UserInputService = FakeService(UIS,"UserInputService"),
118
		ContextActionService = FakeService(CAS,"ContextActionService"),
119
	}
120
	rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
121
	g.service = g.GetService
122
	
123
	g.RunService = FakeService({
124
		RenderStepped = _rg:GetService("RunService").Heartbeat,
125
		BindToRenderStep = function(self,name,_,fun)
126
127
		end,
128
		UnbindFromRenderStep = function(self,name)
129
			self._btrs[name]:Disconnect()
130
		end,
131
	},"RunService")
132
133
	setmetatable(g,{
134
		__index=function(self,s)
135
			return _rg:GetService(s) or typeof(_rg[s])=="function"
136
			and function(_,...)return _rg[s](_rg,...)end or _rg[s]
137
		end,
138
		__newindex = fsmt.__newindex,
139
		__call = fsmt.__call
140
	})
141
	--Changing owner to fake player object to support owner:GetMouse()
142
	game,owner = g,g.Players.LocalPlayer
143
end
144
--[[
145
146
Clockwork Arena made by Fenrier.
147
148
]] 
149
150
it=Instance.new
151
152
vt=Vector3.new
153
154
cf=CFrame.new
155
156
euler=CFrame.fromEulerAnglesXYZ
157
158
angles=CFrame.Angles
159
160
teledebounce=false
161
162
teledebounce2=false
163
164
c=game.Players:children()
165
166
--[[for i=1,#c do
167
168
if c[i].className=="Player" and c[i].Character:findFirstChild("Torso")~=nil then
169
170
c[i].Character.Torso.CFrame=c[i].Character.Torso.CFrame*cf(0,50,0)
171
172
end
173
174
end]]
175
176
 
177
178
if workspace:findFirstChild("Clockwork Arena",true) ~= nil then 
179
180
workspace:findFirstChild("Clockwork Arena",true).Parent = nil 
181
182
end 
183
184
 
185
186
 
187
188
function part(formfactor,parent,reflectance,transparency,brickcolor,material,name,size,cframe)
189
190
local fp = it("Part")
191
192
fp.formFactor = formfactor 
193
194
fp.Parent = parent
195
196
fp.Reflectance = reflectance
197
198
fp.Transparency = transparency
199
200
fp.CanCollide = true 
201
202
fp.Anchored = true
203
204
fp.Locked=true
205
206
fp.BrickColor = brickcolor
207
208
fp.Name = name
209
210
fp.Size = size
211
212
fp.Material = material
213
214
fp.CFrame = cframe
215
216
fp.BottomSurface="Smooth"
217
218
fp.TopSurface="Smooth"
219
220
fp:BreakJoints()
221
222
return fp 
223
224
end 
225
226
 
227
228
function mesh(Mesh,part,meshtype,meshid,offset,scale)
229
230
local mesh = it(Mesh) 
231
232
mesh.Parent = part
233
234
if Mesh=="SpecialMesh" then
235
236
mesh.MeshType = meshtype
237
238
mesh.MeshId = meshid
239
240
end
241
242
mesh.Offset=offset
243
244
mesh.Scale=scale
245
246
return mesh
247
248
end
249
250
 
251
252
function weld(parent,part0,part1,c0)
253
254
local weld = it("Weld") 
255
256
weld.Parent = parent
257
258
weld.Part0 = part0 
259
260
weld.Part1 = part1 
261
262
weld.C0 = c0
263
264
return weld
265
266
end
267
268
 
269
270
local modelzorz = Instance.new("Model") 
271
272
modelzorz.Parent = workspace
273
274
modelzorz.Name = "Clockwork Arena" 
275
276
script.Parent=modelzorz
277
278
CF=cf(0,0,0)
279
280
 
281
282
local prt1=part(3,modelzorz,0,0,BrickColor.new("Dark orange"),"Slate","Part1",vt(400,10,400),CF)
283
284
local prt1b=part(3,modelzorz,0,1,BrickColor.new("Dark orange"),"Slate","Part1",vt(0,0,0),CF*cf(0,20,0))
285
286
light = Instance.new("PointLight")
287
288
light.Brightness = .8
289
290
light.Range = 150
291
292
light.Color = Color3.new(255,255,255)
293
294
light.Parent=prt1b
295
296
numb=0 
297
298
numb2=0
299
300
for i=1,8 do
301
302
local prt2=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part2",vt(300,15,60),CF*euler(0,numb,0)*cf(0,-numb2,0)) 
303
304
numb=numb+0.3925
305
306
numb2=numb2+0.01
307
308
end
309
310
numb=0 
311
312
for i=1,16 do
313
314
local prt3=part(3,modelzorz,0,0,BrickColor.new("Tr. Red"),"Slate","Part3",vt(100,10,2),CF*euler(0,numb,0)*cf(80,3-0.01,0))
315
316
numb=numb+0.3925
317
318
end
319
320
numb=0
321
322
for i=1,4 do
323
324
local prt4=part(3,modelzorz,0,0,BrickColor.new("Tr. Red"),"Slate","Part4",vt(30,11,30),CF*euler(0,numb,0)*cf(80,2.5,0))
325
326
local prt4b=part(3,modelzorz,0,1,BrickColor.new("Tr. Red"),"Slate","Part4",vt(0,0,0),CF*euler(0,numb,0)*cf(80,2.5+20,0))
327
328
light = Instance.new("PointLight")
329
330
light.Brightness = .8
331
332
light.Range = 50
333
334
light.Color = Color3.new(50,50,0)
335
336
light.Parent=prt4b
337
338
numb2=0
339
340
for i=1,8 do
341
342
local prt5=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Part5",vt(10,5,5),prt4.CFrame*euler(0,numb2,0)*cf(8,3.5,0))
343
344
numb2=numb2+0.785
345
346
end
347
348
numb=numb+1.57
349
350
end
351
352
local prt6=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part6",vt(40,10,40),CF*cf(0,10,0))
353
354
numb2=0
355
356
for i=1,4 do
357
358
numb=0
359
360
numb3=0
361
362
for i=1,8 do
363
364
local prt6=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part6",vt(5,10,20+numb3),CF*euler(0,numb2,0)*cf(-20-numb,9.9-numb,0))
365
366
numb=numb+1
367
368
numb3=numb3+0.01
369
370
end
371
372
numb2=numb2+1.57
373
374
end
375
376
numb=0
377
378
numb2=0
379
380
for i=1,8 do
381
382
local prt7=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Part7",vt(15,5,10),CF*euler(0,numb,0)*cf(10,13-numb2,0))
383
384
numb=numb+0.785
385
386
numb2=numb2+0.01
387
388
end
389
390
numb=0
391
392
for i=1,16 do
393
394
if i~=1 and i~=5 and i~=9 and i~=13 then
395
396
local prt8=part(3,modelzorz,0,0,BrickColor.new("Earth yellow"),"Slate","Part8",vt(30,12,70),CF*euler(0,numb,0)*cf(-180,10,0))
397
398
local prt9=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part9",vt(20,13,60),prt8.CFrame)
399
400
numb2=0
401
402
for i=1,6 do
403
404
local prt9b=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part9b",vt(5,31,5),prt8.CFrame*cf(0,0,30+numb2)*euler(0,0,1.57))
405
406
local prt9c=part(3,modelzorz,0,0,BrickColor.new("Earth green"),"Slate","Part9c",vt(3,32,3),prt9b.CFrame)
407
408
light = Instance.new("PointLight")
409
410
light.Brightness = .8
411
412
light.Range = 30
413
414
light.Color = Color3.new(255,255,255)
415
416
light.Parent=prt9c
417
418
numb2=numb2-10
419
420
end
421
422
end
423
424
numb=numb+0.3925
425
426
end
427
428
numb=1.57
429
430
for i=1,3 do
431
432
local prt10=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part10",vt(20,13,80),CF*euler(0,numb,0)*cf(-185,10,0))
433
434
local prt11=part(3,modelzorz,0,0,BrickColor.new("Earth yellow"),"Slate","Part10",vt(10,14,70),prt10.CFrame)
435
436
numb2=0
437
438
for i=1,6 do
439
440
local prt12=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part12",vt(2,11,80),prt10.CFrame*cf(11-numb2,numb2,0))
441
442
numb2=numb2-2
443
444
end
445
446
numb=numb+1.57
447
448
end
449
450
numb=0
451
452
numb2=0
453
454
for i=1,39 do
455
456
if i>=3 then
457
458
local prt13=part(3,modelzorz,0,0,BrickColor.new("Earth yellow"),"Slate","Part13",vt(30,10,40),CF*euler(0,numb,0)*cf(-195,20+numb2,0))
459
460
local prt14=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part14",vt(20,11,30),prt13.CFrame)
461
462
end
463
464
numb2=numb2+0.009
465
466
numb=numb+0.157
467
468
end
469
470
numb=0
471
472
for i=1,40 do
473
474
local prt15=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part15",vt(30,10,40),CF*euler(0,numb,0)*cf(-220,30.5+numb2,0))
475
476
numb3=0
477
478
local prt9b=part(3,modelzorz,0,0,BrickColor.new("Earth green"),"Slate","Part9b",vt(5,35,5),prt15.CFrame*cf(0,0,0)*euler(0,0,1.57))
479
480
local prt9c=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part9c",vt(3,36,3),prt9b.CFrame)
481
482
light = Instance.new("PointLight")
483
484
light.Brightness = .8
485
486
light.Range = 30
487
488
light.Color = Color3.new(255,255,255)
489
490
light.Parent=prt9c
491
492
local prt16=part(3,modelzorz,0,0,BrickColor.new("Earth green"),"Slate","Part16",vt(29.9,11,39.9),prt15.CFrame)
493
494
local prt17=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part17",vt(10,3,10),prt15.CFrame*cf(0,6,0))
495
496
local prt18=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Part18",vt(5,5,5),prt15.CFrame)
497
498
prt18.Shape="Cylinder"
499
500
prt18.CFrame=prt17.CFrame*cf(0,3,0)*euler(0,0,1.57)
501
502
local prt19=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part19",vt(10,3,10),prt18.CFrame*euler(0,0,-1.57)*cf(0,3,0))
503
504
local prt20=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part20",vt(30,10,40),prt19.CFrame*cf(0,6,0))
505
506
local prt21=part(3,modelzorz,0,0,BrickColor.new("Earth green"),"Slate","Part21",vt(29.9,11,39.9),prt20.CFrame)
507
508
local prt22=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part22",vt(150,20,40),prt21.CFrame*cf(50,12,0))
509
510
local prt23=part(3,modelzorz,0,0,BrickColor.new("Earth yellow"),"Slate","Part23",vt(50,50,90),prt22.CFrame*cf(49,30,0)*euler(0,0,0.5))
511
512
local prt24=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Slate","Part24",vt(80,20,20),prt23.CFrame*cf(40,10,0))
513
514
local prt25=part(3,modelzorz,0,0,BrickColor.new("Earth green"),"Slate","Part25",vt(5,40,20),prt24.CFrame*cf(20,0,0))
515
516
local prt26=part(3,modelzorz,0,0.8,BrickColor.new("Bright blue"),"Plastic","Part26",vt(1,80,20),prt24.CFrame*cf(60,0,0)*euler(0,0,1.07))
517
518
numb=numb+0.157
519
520
end
521
522
numb=0
523
524
for i=1,6 do
525
526
local prt27=part(3,modelzorz,0,0,BrickColor.new("Nougat"),"Plastic","Part27",vt(13,50,13),CF*euler(0,numb,0)*cf(120,25,0))
527
528
local msh27=mesh("CylinderMesh",prt27,"","",vt(0,0,0),vt(1,1,1))
529
530
local prt28=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Part28",vt(15,15,15),CF*euler(0,numb,0)*cf(120,10,0))
531
532
local prt29=part(3,modelzorz,0,0,BrickColor.new("Earth green"),"Slate","Part29",vt(10,16,10),prt28.CFrame*euler(1.57,0.785,0))
533
534
local prt30=part(3,modelzorz,0,0,BrickColor.new("Earth green"),"Slate","Part30",vt(10,16,10),prt28.CFrame*euler(0.785,0,1.57))
535
536
numb2=0
537
538
for i=1,6 do
539
540
local prt31=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Part31",vt(15,50,1),prt27.CFrame*euler(0,numb2,0))
541
542
numb2=numb2+0.785
543
544
end
545
546
local prt32=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Part32",vt(15,15,15),CF*euler(0,numb,0)*cf(120,47.5,0))
547
548
local prt33=part(3,modelzorz,0,0,BrickColor.new("Earth green"),"Slate","Part33",vt(10,16,10),prt32.CFrame*euler(1.57,0.785,0))
549
550
local prt34=part(3,modelzorz,0,0,BrickColor.new("Earth green"),"Slate","Part34",vt(10,16,10),prt32.CFrame*euler(0.785,0,1.57))
551
552
local spawn = Instance.new("SpawnLocation") 
553
554
light = Instance.new("PointLight")
555
556
light.Brightness = .8
557
558
light.Range = 100
559
560
light.Parent=spawn
561
562
spawn.Parent = modelzorz
563
564
spawn.CanCollide = false 
565
566
spawn.Anchored = true 
567
568
spawn.Transparency = 1
569
570
spawn.CFrame=CF*euler(0,numb,0)*cf(140,0,0)
571
572
numb=numb+1.04666666
573
574
end
575
576
local prt35=part(3,modelzorz,0,0,BrickColor.new("Earth green"),"Slate","Part35",vt(60,30,40),CF*cf(-180,15,30))
577
578
local prt35a=part(3,modelzorz,0,0,BrickColor.new("Earth yellow"),"Slate","Part35a",vt(10,20,5),CF*cf(-150,15,15))
579
580
local prt36=part(3,modelzorz,0,0,BrickColor.new("Earth green"),"Slate","Part36",vt(60,30,40),CF*cf(-180,15,-30))
581
582
local prt3ba=part(3,modelzorz,0,0,BrickColor.new("Earth yellow"),"Slate","Part3ba",vt(10,20,5),CF*cf(-150,15,-15))
583
584
 
585
586
local Torso1=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Torso",vt(2,2,1),CF*cf(-155,33,-15)*euler(0,1.57,0))
587
588
local LArm1=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Left Arm",vt(1,2,1),Torso1.CFrame*cf(0.8,0,0.5+0.2)*euler(-1,0,-1))
589
590
local RArm1=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Reft Arm",vt(1,2,1),Torso1.CFrame*cf(-0.8,0,0.5+0.2)*euler(-1,0,1))
591
592
local LLeg1=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Left Leg",vt(1,2,1),Torso1.CFrame*cf(0.5,-2,0))
593
594
local RLeg1=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Right Leg",vt(1,2,1),Torso1.CFrame*cf(-0.5,-2,0))
595
596
local Head1=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Head",vt(1,1,1),Torso1.CFrame*cf(0,1.5,0))
597
598
 
599
600
local Torso2=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Torso",vt(2,2,1),CF*cf(-155,33,15)*euler(0,1.57,0))
601
602
local LArm2=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Left Arm",vt(1,2,1),Torso2.CFrame*cf(0.8,0,0.5+0.2)*euler(-1,0,-1))
603
604
local RArm2=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Reft Arm",vt(1,2,1),Torso2.CFrame*cf(-0.8,0,0.5+0.2)*euler(-1,0,1))
605
606
local LLeg2=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Left Leg",vt(1,2,1),Torso2.CFrame*cf(0.5,-2,0))
607
608
local RLeg2=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Right Leg",vt(1,2,1),Torso2.CFrame*cf(-0.5,-2,0))
609
610
local Head2=part(3,modelzorz,0,0,BrickColor.new("Medium stone grey"),"Slate","Head",vt(1,1,1),Torso2.CFrame*cf(0,1.5,0))
611
612
 
613
614
print("BonnieKunG1s's Clockwork Arena loaded.")
615
616
--workspace.Fenrier.Torso.CFrame=teleprt2.CFrame*cf(0,150,0)