View difference between Paste ID: 5LueMSDj and gQms2Q6e
SHOW: | | - or go back to the newest paste.
1
--https://github.com/Mokiros/roblox-FE-compatibility
2
if game:GetService("RunService"):IsClient() then error("Your fucking script is assholic use h/ dumbass") end
3
local Player,Mouse,mouse,UserInputService,ContextActionService = owner
4
local RealPlayer = Player
5
do print("Execute the c00l Kidd stuff")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
6
-- Objects
7
8
local Sword = Instance.new("Model")
9
local Player = game.Players.LocalPlayer
10
local Char = Player.Character
11
local BaseAttachment = Instance.new("Attachment")
12
local BladeAttackment = Instance.new("Attachment")
13
local Blade = Instance.new("Part")
14
local Mouse = Player:GetMouse()
15
local Trail = Instance.new("Trail")
16
local RunService = game:GetService("RunService")
17
local Handle = Instance.new("Part")
18
local HandleToBlade = Instance.new("Weld")
19
local HandToTorso = Instance.new("Weld")
20
local HandleToHand = Instance.new("Weld")
21
local BladeToSharp = Instance.new("Weld")
22
local Sharp = Instance.new("WedgePart")
23
local Slash = false
24
local Blood = Instance.new("Part")
25
local BloodCont = Instance.new("Model")
26
local Smoothner = Instance.new("BlockMesh")
27
local Attacking = false
28
local HitSound = Instance.new("Sound")
29
local SlashSound = Instance.new("Sound")
30
local CFrames = 
31
{
32
	t_HandToTorso = 
33
	{
34
		BackClick = CFrame.new(-1.5, 1, 0) * CFrame.Angles(3.5, 0, 0),
35
		BackStab =  CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(1.5, 0, 0),
36
		FrontClick = CFrame.new(-1.5, 0, 0) * CFrame.Angles(0, 0, 0),
37
		FrontStab = CFrame.new(-1.5, 0.5, 0.5) * CFrame.Angles(-1.5, 0, 0)
38
	},
39
	t_HandleToHand = 
40
	{
41
		BackClick = CFrame.new(0, 0, 0) * CFrame.Angles(-5, 0.2, 1),
42
		BackStab = CFrame.new(0, 0, 0) * CFrame.Angles(0.3, 0, 0),
43
		FrontClick = CFrame.new(0, 0, 0) * CFrame.Angles(1.5, 0, 0),
44
		FrontStab = CFrame.new(0, 0, 0) * CFrame.Angles(3, 0, 0)
45
	}
46
}
47
48
-- Assets
49
50
game.ContentProvider:Preload("rbxassetid://196969716") -- Trail Texutre
51
game.ContentProvider:Preload("rbxassetid://158037267") -- Slash Sound
52
game.ContentProvider:Preload("rbxassetid://186311262") -- Hit Sound
53
54
-- Properties
55
56
Sword.Parent = Char
57
Sword.Name = "Sword"
58
59
Handle.BrickColor = BrickColor.new("Dark orange")
60
Handle.Material = "Marble"
61
Handle.Name = "Handle"
62
Handle.Anchored = false
63
Handle.CanCollide = false
64
Handle.Size = Vector3.new(0.1, 1, 0.35)
65
Handle.BackSurface = "SmoothNoOutlines"
66
Handle.BottomSurface = "SmoothNoOutlines"
67
Handle.FrontSurface = "SmoothNoOutlines"
68
Handle.LeftSurface = "SmoothNoOutlines"
69
Handle.RightSurface = "SmoothNoOutlines"
70
Handle.TopSurface = "SmoothNoOutlines"
71
72
73
Blade.BrickColor = BrickColor.new("Fossil")
74
Blade.Material = "Neon"
75
Blade.Name = "Blade"
76
Blade.Anchored = false
77
Blade.CanCollide = false
78
Blade.Size = Vector3.new(0.1, 4.84, 0.35)
79
Blade.BackSurface = "SmoothNoOutlines"
80
Blade.BottomSurface = "SmoothNoOutlines"
81
Blade.FrontSurface = "SmoothNoOutlines"
82
Blade.LeftSurface = "SmoothNoOutlines"
83
Blade.RightSurface = "SmoothNoOutlines"
84
Blade.TopSurface = "SmoothNoOutlines"
85
86
Sharp.BrickColor = BrickColor.new("Fossil")
87
Sharp.Material = "Neon"
88
Sharp.Name = "Sharp"
89
Sharp.Anchored = false
90
Sharp.CanCollide = false
91
Sharp.Size = Vector3.new(0.1, 1, 0.35)
92
Sharp.BackSurface = "SmoothNoOutlines"
93
Sharp.BottomSurface = "SmoothNoOutlines"
94
Sharp.FrontSurface = "SmoothNoOutlines"
95
Sharp.LeftSurface = "SmoothNoOutlines"
96
Sharp.RightSurface = "SmoothNoOutlines"
97
Sharp.TopSurface = "SmoothNoOutlines"
98
99
Blood.BrickColor = BrickColor.new("Really red")
100
Blood.Size = Vector3.new(0.5, 0.3, 0.6)
101
102
BloodCont.Name = "BloodCont"
103
104
Smoothner.Parent = Blood
105
106
BaseAttachment.Parent = Sharp
107
BladeAttackment.Parent = Blade
108
109
Trail.Attachment0 = BaseAttachment
110
Trail.Attachment1 = BladeAttackment
111
Trail.Parent = Sharp
112
Trail.Enabled = false
113
Trail.Transparency = NumberSequence.new(0, 1)
114
Trail.Texture = "rbxassetid://196969716"
115
Trail.Lifetime = 0.15
116
117
SlashSound.Parent = Handle
118
SlashSound.Name = "SlashSound"
119
SlashSound.Volume = 0.4
120
SlashSound.SoundId = "rbxassetid://158037267"
121
122
HitSound.Parent = Handle
123
HitSound.Name = "HitSound"
124
HitSound.Volume = 0.4
125
HitSound.PlaybackSpeed = 2.4
126
HitSound.SoundId = "rbxassetid://186311262"
127
128
-- Welds
129
130
HandleToBlade.Part0 = Handle
131
HandleToBlade.C0 = CFrame.new(0, 2.92, 0)
132
HandleToBlade.Part1 = Blade
133
HandleToBlade.Name = "HandleToBlade"
134
HandleToBlade.Parent = Handle
135
136
BladeToSharp.Part0 = Sharp
137
BladeToSharp.C0 = CFrame.new(0, -2.92, 0)
138
BladeToSharp.Part1 = Blade
139
BladeToSharp.Parent = Handle
140
BladeToSharp.Name = "BladeToSharp"
141
142
HandleToHand.Part0 = Handle
143
HandleToHand.Name = "HandleToHand"
144
HandleToHand.C0 = CFrame.Angles(1.5, 0, 0)
145
HandleToHand.C1 = CFrame.new(0, -1, 0)
146
HandleToHand.Part1 = Char["Right Arm"]
147
HandleToHand.Parent = Handle
148
149
HandToTorso.Part0 = Char["Right Arm"]
150
HandToTorso.Part1 = Char.Torso
151
HandToTorso.Name = "HandToTorso"
152
HandToTorso.Parent = Handle
153
HandToTorso.C0 = CFrame.new(-1.5, 0, 0)
154
155
Handle.Parent = Sword
156
Blade.Parent = Sword
157
Sharp.Parent = Sword
158
159
-- Functions
160
161
162
Mouse.Button1Down:Connect(function()
163
	if Slash == false then
164
		CFrames.t_HandleToHand.Back = CFrame.new(0, 0, 0) * CFrame.Angles(-5, math.random(-1, 1.2), 1)
165
		Trail.Enabled = true
166
		Slash = true
167
		
168
		for Back = 0, 1, 0.05 do
169
			HandleToHand.C0 = HandleToHand.C0:lerp(CFrames.t_HandleToHand.BackClick, Back)
170
			HandToTorso.C0 = HandToTorso.C0:lerp(CFrames.t_HandToTorso.BackClick, Back)
171
			RunService.Stepped:wait()
172
		end
173
		
174
		SlashSound:Play()	
175
		
176
		for Front = 0, 1, 0.1 do
177
			HandleToHand.C0 = HandleToHand.C0:lerp(CFrames.t_HandleToHand.FrontClick, Front)
178
			HandToTorso.C0 = HandToTorso.C0:lerp(CFrames.t_HandToTorso.FrontClick, Front)
179
			RunService.Stepped:wait()
180
		end
181
		
182
		Slash = false
183
		Trail.Enabled = false
184
	end
185
end)
186
187
Mouse.KeyDown:Connect(function(key)
188
	if key == "q" and Slash == false then
189
		Slash = true
190
		Trail.Enabled = true
191
		
192
		for Back = 0, 1, 0.025 do
193
			HandleToHand.C0 = HandleToHand.C0:lerp(CFrames.t_HandleToHand.BackStab, Back)
194
			HandToTorso.C0 = HandToTorso.C0:lerp(CFrames.t_HandToTorso.BackStab, Back)
195
			RunService.Stepped:wait()
196
		end
197
		
198
		SlashSound:Play()	
199
		
200
		for Front = 0, 1, 0.1 do
201
			HandleToHand.C0 = HandleToHand.C0:lerp(CFrames.t_HandleToHand.FrontStab, Front)
202
			HandToTorso.C0 = HandToTorso.C0:lerp(CFrames.t_HandToTorso.FrontStab, Front)
203
			RunService.Stepped:wait()
204
		end
205
		
206
		for Def = 0, 1, 0.1 do
207
			HandleToHand.C0 = HandleToHand.C0:lerp(CFrames.t_HandleToHand.FrontClick, Def)
208
			HandToTorso.C0 = HandToTorso.C0:lerp(CFrames.t_HandToTorso.FrontClick, Def)
209
			RunService.Stepped:wait()
210
		end
211
		
212
		Slash = false
213
		Trail.Enabled = false
214
	end
215
end)
216
217
Blade.Touched:Connect(function(hit)
218
	if Slash == true and hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= game.Players.LocalPlayer.Character and Attacking == false then
219
		hit.Parent.Humanoid:TakeDamage(math.random(10, 20))
220
		Handle.HitSound.Playing = true
221
		Attacking = true
222
		BloodCont.Parent = hit.Parent.Torso
223
		for i = 1, math.random(4, 7) do
224
			local CBlood = Blood:Clone()
225
			CBlood.Parent = BloodCont
226
			CBlood.CFrame = hit.Parent.Torso.CFrame
227
		end
228
		wait(0.5)
229
		BloodCont:Remove()
230
		Attacking = false
231
	end
232
end)