View difference between Paste ID: GX5uqFfc and 78sXJrW0
SHOW: | | - or go back to the newest paste.
1
--Made by Ahtoh13131423144235
2
-- This script has been converted to FE by iPxter
3-
local player=game.Players.LocalPlayer
3+
4-
local mouse=player:GetMouse()
4+
5
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
6
local Player,Mouse,mouse,UserInputService,ContextActionService = owner
7
do
8
	print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
9
	script.Parent = Player.Character
10
11
	--RemoteEvent for communicating
12
	local Event = Instance.new("RemoteEvent")
13
	Event.Name = "UserInput_Event"
14
15
	--Fake event to make stuff like Mouse.KeyDown work
16
	local function fakeEvent()
17
		local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
18
		t.connect = t.Connect
19
		return t
20
	end
21
22
	--Creating fake input objects with fake variables
23
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
24
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
25
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
26
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
27
	end}
28
	--Merged 2 functions into one by checking amount of arguments
29
	CAS.UnbindAction = CAS.BindAction
30
31
	--This function will trigger the events that have been :Connect()'ed
32
	local function te(self,ev,...)
33
		local t = m[ev]
34
		if t and t._fakeEvent and t.Function then
35
			t.Function(...)
36
		end
37
	end
38
	m.TrigEvent = te
39
	UIS.TrigEvent = te
40
41
	Event.OnServerEvent:Connect(function(plr,io)
42
	    if plr~=Player then return end
43
		if io.isMouse then
44
			m.Target = io.Target
45
			m.Hit = io.Hit
46
		else
47
			local b = io.UserInputState == Enum.UserInputState.Begin
48
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
49
				return m:TrigEvent(b and "Button1Down" or "Button1Up")
50
			end
51
			for _,t in pairs(CAS.Actions) do
52
				for _,k in pairs(t.Keys) do
53
					if k==io.KeyCode then
54
						t.Function(t.Name,io.UserInputState,io)
55
					end
56
				end
57
			end
58
			m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
59
			UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
60
	    end
61
	end)
62
	Event.Parent = NLS([==[
63
	local Player = game:GetService("Players").LocalPlayer
64
	local Event = script:WaitForChild("UserInput_Event")
65
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})
71
	end
72
	UIS.InputBegan:Connect(input)
73
	UIS.InputEnded:Connect(input)
74
75
	local Mouse = Player:GetMouse()
76
	local h,t
77
	--Give the server mouse data 30 times every second, but only if the values changed
78
	--If player is not moving their mouse, client won't fire events
79
	while wait(1/30) do
80
		if h~=Mouse.Hit or t~=Mouse.Target then
81
			h,t=Mouse.Hit,Mouse.Target
82
			Event:FireServer({isMouse=true,Target=t,Hit=h})
83
		end
84
	end]==],Player.Character)
85
	Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
86
end
87
local player=owner
88
local char=player.Character
89
local canAttack=true
90
local mode=0
91
92
local gui=Instance.new("ScreenGui")
93
gui.Parent=player.PlayerGui
94
gui.Name="StaffGui"
95
local tip=Instance.new("TextLabel")
96
tip.Parent=gui
97
tip.Name="Tip"
98
tip.Text="Press 'E' to change modes."
99
tip.BackgroundTransparency=1
100
tip.TextColor3=Color3.new(0,0,255)
101
tip.Size=UDim2.new(0,200,0,50)
102
tip.Position=UDim2.new(0,0,0,200)
103
local modeText=Instance.new("TextLabel")
104
modeText.Parent=gui
105
modeText.Name="Mode"
106
modeText.Text="Laser"
107
modeText.BackgroundColor3=Color3.new(0,0,230)
108
modeText.TextSize=20
109
modeText.Size=UDim2.new(0,90,0,50)
110
modeText.Position=UDim2.new(0,40,0,250)
111
112
local staff=Instance.new("Model")
113
staff.Parent=char
114
staff.Name="Staff"
115
local handle=Instance.new("Part")
116
handle.Parent=staff
117
handle.Name="Handle"
118
handle.BrickColor=BrickColor.new("Black")
119
handle.Size=Vector3.new(0.5,5,0.5)
120
handle.Anchored=false
121
handle.CanCollide=true
122
handle.Position=Vector3.new(0,1,0)
123
local handleMesh=Instance.new("SpecialMesh")
124
handleMesh.Parent=handle
125
handleMesh.Name="HandleMesh"
126
local holdPart=Instance.new("Part")
127
holdPart.Parent=staff
128
holdPart.Name="HoldPart"
129
holdPart.BrickColor=BrickColor.new("Cyan")
130
holdPart.Size=Vector3.new(0.6,0.9,0.6)
131
holdPart.Anchored=false
132
holdPart.CanCollide=true
133
holdPart.Position=Vector3.new(0,1,0)
134
local holdPartMesh=Instance.new("SpecialMesh")
135
holdPartMesh.Parent=holdPart
136
holdPartMesh.Name="HoldPartMesh"
137
local grip1=Instance.new("Part")
138
grip1.Parent=staff
139
grip1.Name="Grip1"
140
grip1.BrickColor=BrickColor.new("Black")
141
grip1.Size=Vector3.new(0.7,0.2,0.7)
142
grip1.Anchored=false
143
grip1.CanCollide=true
144
grip1.Position=Vector3.new(0,1,0)
145
local grip1Mesh=Instance.new("SpecialMesh")
146
grip1Mesh.Parent=grip1
147
grip1Mesh.Name="Grip1Mesh"
148
grip1Mesh.MeshType="Sphere"
149
local grip2=Instance.new("Part")
150
grip2.Parent=staff
151
grip2.Name="Grip2"
152
grip2.BrickColor=BrickColor.new("Black")
153
grip2.Size=Vector3.new(0.7,0.2,0.7)
154
grip2.Anchored=false
155
grip2.CanCollide=true
156
grip2.Position=Vector3.new(0,1,0)
157
local grip2Mesh=Instance.new("SpecialMesh")
158
grip2Mesh.Parent=grip2
159
grip2Mesh.Name="Grip2Mesh"
160
grip2Mesh.MeshType="Sphere"
161
local grip3=Instance.new("Part")
162
grip3.Parent=staff
163
grip3.Name="Grip3"
164
grip3.BrickColor=BrickColor.new("Black")
165
grip3.Size=Vector3.new(0.9,0.2,0.9)
166
grip3.Anchored=false
167
grip3.CanCollide=true
168
grip3.Position=Vector3.new(0,1,0)
169
local grip3Mesh=Instance.new("SpecialMesh")
170
grip3Mesh.Parent=grip3
171
grip3Mesh.Name="Grip3Mesh"
172
grip3Mesh.MeshType="Sphere"
173
local grip4=Instance.new("Part")
174
grip4.Parent=staff
175
grip4.Name="Grip4"
176
grip4.BrickColor=BrickColor.new("Black")
177
grip4.Size=Vector3.new(0.7,0.2,0.7)
178
grip4.Anchored=false
179
grip4.CanCollide=true
180
grip4.Position=Vector3.new(0,1,0)
181
local grip4Mesh=Instance.new("SpecialMesh")
182
grip4Mesh.Parent=grip4
183
grip4Mesh.Name="Grip4Mesh"
184
grip4Mesh.MeshType="Sphere"
185
local glow=Instance.new("Part")
186
glow.Parent=staff
187
glow.Name="Glow"
188
glow.BrickColor=BrickColor.new("Cyan")
189
glow.Size=Vector3.new(2,2,2)
190
glow.Transparency=0.50
191
glow.Anchored=false
192
glow.CanCollide=true
193
glow.Position=Vector3.new(0,1,0)
194
glow.TopSurface="Smooth"
195
glow.BottomSurface="Smooth"
196
local glowMesh=Instance.new("SpecialMesh")
197
glowMesh.Parent=glow
198
glowMesh.Name="GlowMesh"
199
glowMesh.MeshType="Sphere"
200
local crystal=Instance.new("Part")
201
crystal.Parent=staff
202
crystal.Name="Crystal"
203
crystal.BrickColor=BrickColor.new("Cyan")
204
crystal.Size=Vector3.new(1,0.4,1)
205
crystal.Anchored=false
206
crystal.CanCollide=true
207
local crystalMesh=Instance.new("SpecialMesh")
208
crystalMesh.Parent=crystal
209
crystalMesh.Name="CrystalMesh"
210
crystalMesh.MeshType="FileMesh"
211
crystalMesh.MeshId="http://www.roblox.com/Asset/?id=9756362"
212
local w1=Instance.new("Weld")
213
w1.Parent=char["Right Arm"]
214
w1.Name="HandleWeld"
215
w1.Part0=char["Right Arm"]
216
w1.Part1=handle
217
w1.C0=CFrame.new(0,-1.1,0)*CFrame.fromEulerAnglesXYZ(1.57,0,0)
218
local w2=Instance.new("Weld")
219
w2.Parent=handle
220
w2.Name="HoldPartWeld"
221
w2.Part0=handle
222
w2.Part1=holdPart
223
w2.C0=CFrame.new(0,2.1,0)
224
local w3=Instance.new("Weld")
225
w3.Parent=handle
226
w3.Name="Grip1Weld"
227
w3.Part0=handle
228
w3.Part1=grip1
229
w3.C0=CFrame.new(0,2.1,0)
230
local w4=Instance.new("Weld")
231
w4.Parent=handle
232
w4.Name="Grip2Weld"
233
w4.Part0=handle
234
w4.Part1=grip2
235
w4.C0=CFrame.new(0,-1.7,0)
236
local w5=Instance.new("Weld")
237
w5.Parent=handle
238
w5.Name="Grip3Weld"
239
w5.Part0=handle
240
w5.Part1=grip3
241
w5.C0=CFrame.new(0,-2.1,0)
242
local w6=Instance.new("Weld")
243
w6.Parent=handle
244
w6.Name="Grip4Weld"
245
w6.Part0=handle
246
w6.Part1=grip4
247
w6.C0=CFrame.new(0,-2.4,0)
248
local w7=Instance.new("Weld")
249
w7.Parent=handle
250
w7.Name="GlowWeld"
251
w7.Part0=handle
252
w7.Part1=glow
253
w7.C0=CFrame.new(0,-3,0)
254
local w8=Instance.new("Weld")
255
w8.Parent=handle
256
w8.Name="CrystalWeld"
257
w8.Part0=handle
258
w8.Part1=crystal
259
w8.C0=CFrame.new(0,-3,0)
260
local rs=Instance.new("Weld")
261
rs.Parent=char.Torso
262
rs.Name="RightArmWeld"
263
rs.Part0=char.Torso
264
rs.Part1=char["Right Arm"]
265
rs.C0=CFrame.new(1.5,0.5,0)
266
rs.C1=CFrame.new(0,0.5,0)
267
local ls=Instance.new("Weld")
268
ls.Parent=char.Torso
269
ls.Name="LeftArmWeld"
270
ls.Part0=char.Torso
271
ls.Part1=char["Left Arm"]
272
ls.C0=CFrame.new(-1.5,0.5,0)
273
ls.C1=CFrame.new(0,0.5,0)
274
275
mouse.Button1Down:connect(function()
276
if mode==0 and canAttack==true then
277
canAttack=false
278
for i=1,10 do
279
rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(math.pi/20,0,0)
280
wait()
281
end
282
for i=1,10 do
283
w1.C0=w1.C0*CFrame.fromEulerAnglesXYZ(math.pi/-20,0,0)
284
wait()
285
end
286
wait(1)
287
local laser=Instance.new("Part")
288
laser.Parent=staff
289
laser.Name="Laser"
290
laser.BrickColor=BrickColor.new("Cyan")
291
laser.Size=Vector3.new(1,15,1)
292
laser.Transparency=0.50
293
laser.Anchored=false
294
laser.CanCollide=true
295
laser.Position=Vector3.new(0,10,0)
296
local laserMesh=Instance.new("SpecialMesh")
297
laserMesh.Parent=laser
298
laserMesh.Name="LaserMesh"
299
local w9=Instance.new("Weld")
300
w9.Parent=glow
301
w9.Name="LaserWeld"
302
w9.Part0=glow
303
w9.Part1=laser
304
w9.C0=CFrame.new(0,-7,0)
305
laser.Touched:connect(function(hit)
306
if hit.Parent:FindFirstChild("Humanoid")~=nil and hit.Parent~=char then
307
hit.Anchored=true
308
for i=1,200 do
309
hit.Parent:FindFirstChild("Humanoid").Health=hit.Parent:FindFirstChild("Humanoid").Health-0.1
310
wait()
311
end
312
end
313
end)
314
wait(0.7)
315
for i=1,50 do
316
laser.Transparency=laser.Transparency+0.01
317
wait()
318
end
319
laser:remove()
320
for i=1,10 do
321
w1.C0=w1.C0*CFrame.fromEulerAnglesXYZ(math.pi/20,0,0)
322
wait()
323
end
324
for i=1,10 do
325
rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(math.pi/-20,0,0)
326
wait()
327
end
328
canAttack=true
329
elseif mode==1 and canAttack==true then
330
canAttack=false
331
for i=1,20 do
332
rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(math.pi/20,0,0)
333
wait()
334
end
335
for i=1,10 do
336
w1.C0=w1.C0*CFrame.fromEulerAnglesXYZ(math.pi/-20,0,0)
337
wait()
338
end
339
wait(1)
340
local explosion=Instance.new("Explosion")
341
explosion.Parent=crystal
342
explosion.Position=crystal.Position
343
explosion.BlastPressure=0
344
explosion.Hit:connect(function(hit)
345
if hit.Parent:FindFirstChild("Humanoid")~=nil and hit.Parent~=char then
346
hit.Parent:BreakJoints()
347
end
348
end)
349
for i=1,10 do
350
w1.C0=w1.C0*CFrame.fromEulerAnglesXYZ(math.pi/20,0,0)
351
wait()
352
end
353
for i=1,20 do
354
rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(math.pi/-20,0,0)
355
wait()
356
end
357
canAttack=true
358
elseif mode==2 and canAttack==true then
359
canAttack=false
360
for i=1,10 do
361
rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(math.pi/20,0,0)
362
ls.C0=ls.C0*CFrame.fromEulerAnglesXYZ(math.pi/20,0,0)
363
wait()
364
end
365
for i=1,5 do
366
rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-20)
367
ls.C0=ls.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/20)
368
wait()
369
end
370
for i=1,5 do
371
rs.C0=rs.C0*CFrame.new(0,math.pi/-20,0)
372
ls.C0=ls.C0*CFrame.new(0,math.pi/-20,0)
373
wait()
374
end
375
wait(0.5)
376
glow.BrickColor=BrickColor.new("Bright green")
377
crystal.BrickColor=BrickColor.new("Bright green")
378
holdPart.BrickColor=BrickColor.new("Bright green")
379
char.Humanoid.Health=char.Humanoid.MaxHealth
380
wait(0.7)
381
glow.BrickColor=BrickColor.new("Cyan")
382
crystal.BrickColor=BrickColor.new("Cyan")
383
holdPart.BrickColor=BrickColor.new("Cyan")
384
for i=1,5 do
385
rs.C0=rs.C0*CFrame.new(0,math.pi/20,0)
386
ls.C0=ls.C0*CFrame.new(0,math.pi/20,0)
387
wait()
388
end
389
for i=1,5 do
390
rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/20)
391
ls.C0=ls.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-20)
392
wait()
393
end
394
for i=1,10 do
395
rs.C0=rs.C0*CFrame.fromEulerAnglesXYZ(math.pi/-20,0,0)
396
ls.C0=ls.C0*CFrame.fromEulerAnglesXYZ(math.pi/-20,0,0)
397
wait()
398
end
399
canAttack=true
400
end
401
end)
402
403
mouse.KeyDown:connect(function(key)
404
if key=="e" then
405
if mode<3 then
406
mode=mode+1
407
else
408
mode=0
409
end
410
end
411
end)
412
413
while wait() do
414
if mode==0 then
415
modeText.Text="Laser"
416
elseif mode==1 then
417
modeText.Text="Blast"
418
elseif mode==2 then
419
modeText.Text="Charge"
420
end
421
end