View difference between Paste ID: S48dKjtq and bDjL6Svg
SHOW: | | - or go back to the newest paste.
1
-- This script has been converted to FE by iPxter
2-
local plr = game:GetService("Players").LocalPlayer
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
87
script.Parent = workspace.CurrentCamera
88
local plr = game:GetService("Players").wrrrryyyyyyyyyyyyyyy
89
90
local tool = Instance.new("Tool",plr:WaitForChild("Backpack"))
91
tool.Grip = CFrame.new(0,-0.2,-1.6) * CFrame.Angles(math.rad(100),math.rad(180),math.rad(0))
92
tool.Name = "bluE"
93
94
local part = Instance.new("Part",tool)
95
part.Name = "Handle"
96
part.Size = Vector3.new(4,6,4)
97
part.TopSurface = "Smooth"
98
part.BottomSurface = "Smooth"
99
part.CanCollide = false
100
part:BreakJoints()
101
102
local mesh = Instance.new("SpecialMesh",part)
103
mesh.MeshId = "rbxassetid://24342877" --mesh.MeshId = "rbxassetid://132920499"
104
mesh.TextureId = "rbxassetid://139521211" --"http://www.roblox.com/asset/?id=134479421"
105
mesh.Scale = Vector3.new(2,2,2)
106
107
local sound = Instance.new("Sound",part)
108
sound.SoundId = "rbxassetid://2791831469"
109
sound.Volume = 999999999999999999999
110
111
local sound2 = Instance.new("Sound",part)
112
sound2.SoundId = "rbxassetid://2791831469"
113
sound2.Volume = 999999999999999999999
114
115
local sound3 = Instance.new("Sound",part)
116
sound3.SoundId = "rbxassetid://2791831469"
117
sound3.Volume = 999999999999999999999
118
119
local sound4 = Instance.new("Sound",part)
120
sound4.SoundId = "rbxassetid://2791831469"
121
sound4.Volume = 999999999999999999999
122
123
local sound5 = Instance.new("Sound",part)
124
sound5.SoundId = "rbxassetid://2791831469"
125
sound5.Volume = 999999999999999999999
126
127
local sound6 = Instance.new("Sound",part)
128
sound6.SoundId = "rbxassetid://2791831469"
129
sound6.Volume = 999999999999999999999
130
sound6.TimePosition = 2
131
132
function firstHum(target)
133
	for i,v in pairs(target:GetChildren()) do
134
		if v:IsA("Humanoid") then
135
			return v
136
		end
137
	end
138
	return nil
139
end
140
141
local slap = false
142
local cd = false
143
144
plr:GetMouse().Button1Down:connect(function()
145
	if tool.Parent == plr.Character then
146
		if slap == false then
147
			slap = true
148
			sound2:Play()
149
			local str = Instance.new("StringValue")
150
			str.Name = "toolanim"
151
			str.Value = "Slash"
152
			str.Parent = tool
153
			wait(1)
154
			slap = false
155
		end
156
	end
157
end)
158
159
part.Touched:connect(function(hit)
160
	if slap == true then
161
		if cd == false then
162
			if not hit:IsDescendantOf(plr.Character) then
163
				if hit.Parent:IsA("Model") then
164
					local fhum = firstHum(hit.Parent)
165
					if fhum then
166
						cd = true
167
						fhum.PlatformStand = true
168
						sound:Play()
169
						local con1
170
						con1 = game:GetService("RunService").Heartbeat:connect(function()
171
							fhum.PlatformStand = true
172
						end)
173
						wait(0.1)
174
						local vel = Instance.new("BodyVelocity",hit)
175
						vel.Velocity = ((hit.Position - plr.Character:WaitForChild("HumanoidRootPart").Position).unit + Vector3.new(0,0.5,0))*50
176
						vel.MaxForce = Vector3.new(10000000,10000000,10000000)
177
						wait(1)
178
						cd = false
179
						vel:Destroy()
180
						local vel2 = Instance.new("BodyVelocity",hit)
181
						vel2.Velocity = Vector3.new(0,12.5,0)
182
						vel2.MaxForce = Vector3.new(10000000,10000000,10000000)
183
						local p2 = Instance.new("Part",hit)
184
						p2.Anchored = true
185
						p2.Transparency = 0.6
186
						p2.CanCollide = false
187
						p2.Size = Vector3.new(0.2,0.2,0.2)
188
						p2.CFrame = CFrame.new(hit.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
189
						p2.BrickColor = BrickColor.new("New Yeller")
190
						p2.Material = "Neon"
191
						local m2 = Instance.new("CylinderMesh",p2)
192
						m2.Scale = Vector3.new(60,10000,60)
193
						local scln = sound3:Clone()
194
						scln.Parent = hit
195
						scln:Play()
196
						local con2
197
						con2 = game:GetService("RunService").Heartbeat:connect(function()
198
							p2.CFrame = CFrame.new(hit.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
199
						end)
200
						wait(7)
201
						vel2.Velocity = Vector3.new(0,0,0)
202
						wait(0.5)
203
						scln:Stop()
204
						local scln3 = sound5:Clone()
205
						scln3.Parent = hit
206
						scln3:Play()
207
						wait(1)
208
						local bav = Instance.new("BodyAngularVelocity",hit)
209
						bav.AngularVelocity = Vector3.new(math.random(0,360),math.random(0,360),math.random(0,360))
210
						vel2.Velocity = Vector3.new(0,-250,0)
211
						p2.BrickColor = BrickColor.new("Really red")
212
						local scln6 = sound6:Clone()
213
						scln6.Parent = hit
214
						scln6:Play()
215
						local continue = false
216
						local htc
217
						htc = hit.Touched:connect(function(hitp)
218
							if not hitp:IsDescendantOf(hit.Parent) then
219
								continue = true
220
								scln6:Stop()
221
								vel2:Destroy()
222
								con2:Disconnect()
223
								con1:Disconnect()
224
								htc:Disconnect()
225
								p2:Destroy()
226
							end
227
						end)
228
						repeat wait() until continue == true
229
						local ctab = {}
230
						for i=1,4 do
231
							local p = Instance.new("Part",hit)
232
							p.Size = Vector3.new(30,30,30)
233
							p.Anchored = true
234
							p.CanCollide = false
235
							p.TopSurface = "Smooth"
236
							p.BottomSurface = "Smooth"
237
							p.Color = Color3.fromRGB(255,math.random(0,255),0)
238
							p.CFrame = hit.CFrame
239
							local con
240
							con = game:GetService("RunService").Heartbeat:connect(function()
241
								p.CFrame = p.CFrame * CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))
242
								p.Transparency = p.Transparency + 0.01
243
								if p.Transparency >= 1 then
244
									con:Disconnect()
245
								end
246
							end)
247
							table.insert(ctab,con)
248
						end	
249
						Instance.new("Explosion",workspace).Position = hit.Position
250
						local scln2 = sound4:Clone()
251
						scln2.Parent = hit
252
						scln2:Play()
253
						vel2:Destroy()
254
						hit.Parent:BreakJoints()
255
						repeat wait() until not hit:IsDescendantOf(workspace)
256
						con2:Disconnect()
257
					end
258
				end
259
			end
260
		end
261
	end
262
end)