View difference between Paste ID: y8YE4Uuq and VcVDYsZj
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,Mouse,mouse,UserInputService,ContextActionService = owner
3
local RealPlayer = Player
4
do print("FE Compatibility code by Mokiros")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
5
6
local plr = owner
7
local char = plr.Character
8
9
local m = Instance.new("Model", game.Workspace)
10
m.Name = "Guest666"
11
12
local h = Instance.new("Part",m)
13
h.Name = "Head"
14
local me = plr.Character.Head.Mesh:Clone()
15
me.Parent = h
16
local facee = plr.Character.Head.face:Clone()
17
facee.Parent = h
18
h.Size = plr.Character.Head.Size
19
h:BreakJoints()
20
h.CanCollide = false
21
h.Position = plr.Character.Head.Position
22
h.Position = h.Position + Vector3.new(0, 10, 0)
23
h.face.Texture = "http://www.roblox.com/asset/?id=1282052398"
24
25
local t = Instance.new("Part",m)
26
t.Name = "Torso"
27
t.Size = plr.Character.Torso.Size
28
t:BreakJoints()
29
t.CanCollide = false
30
t.Position = plr.Character.Torso.Position
31
t.Position = t.Position + Vector3.new(0, 10, 0)
32
33
local r = Instance.new("Part",m)
34
r.Name = "HumanoidRootPart"
35
r.Size = plr.Character.Torso.Size
36
r:BreakJoints()
37
r.CanCollide = false
38
r.Position = plr.Character.Torso.Position
39
r.Position = t.Position + Vector3.new(0, 10, 0)
40
r.Transparency = 1
41
42
local ra = Instance.new("Part",m)
43
ra.Name = "Right Arm"
44
ra.Size = plr.Character["Right Arm"].Size
45
ra:BreakJoints()
46
ra.Position = plr.Character["Right Arm"].Position
47
ra.Position = ra.Position + Vector3.new(0, 10, 0)
48
49
local la = Instance.new("Part",m)
50
la.Name = "Left Arm"
51
la.Size = plr.Character["Left Arm"].Size
52
la:BreakJoints()
53
la.Position = plr.Character["Left Arm"].Position
54
la.Position = la.Position + Vector3.new(0, 10, 0)
55
56
local ll = Instance.new("Part",m)
57
ll.Name = "Left Leg"
58
ll.Size = plr.Character["Left Leg"].Size
59
ll:BreakJoints()
60
ll.Position = plr.Character["Left Leg"].Position
61
ll.Position = ll.Position + Vector3.new(0, 10, 0)
62
63
local rl = Instance.new("Part",m)
64
rl.Name = "Right Leg"
65
rl.Size = plr.Character["Right Leg"].Size
66
rl:BreakJoints()
67
rl.Position = plr.Character["Right Leg"].Position
68
rl.Position = rl.Position + Vector3.new(0, 10, 0)
69
70
for i,v in pairs(m:GetChildren()) do
71
 v:BreakJoints()
72
end
73
74
local rootj = Instance.new("Motor6D")
75
rootj.Name = "RootJoint"
76
rootj.Part0 = r
77
rootj.Part1 = t
78
rootj.Parent = r
79
80
local neck = Instance.new("Motor6D")
81
neck.Name = "Neck"
82
neck.Part0 = t
83
neck.Part1 = h
84
neck.Parent = t
85
neck.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
86
neck.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
87
88
local RS = Instance.new("Motor6D")
89
RS.Name = "Right Shoulder"
90
RS.Part0 = t
91
RS.Part1 = ra
92
RS.Parent = t
93
RS.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
94
RS.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
95
96
local LS = Instance.new("Motor6D")
97
LS.Name = "Left Shoulder"
98
LS.Part0 = t
99
LS.Part1 = la
100
LS.Parent = t
101
LS.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
102
LS.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
103
104
local LH = Instance.new("Motor6D")
105
LH.Name = "Left Hip"
106
LH.Part0 = t
107
LH.Part1 = ll
108
LH.Parent = t
109
LH.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
110
LH.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
111
112
local RH  = Instance.new("Motor6D")
113
RH.Name = "Right Hip"
114
RH.Part0 = t
115
RH.Part1 = rl
116
RH.Parent = t
117
RH.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
118
RH.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
119
120
wait(0.000000000000001)
121
122
local hu = Instance.new("Humanoid", m)
123
hu.MaxHealth = 0
124
hu.Health = 0
125
hu.WalkSpeed = 16
126
127
h.BrickColor = BrickColor.new("Really black")
128
ra.BrickColor = BrickColor.new("Really black")
129
la.BrickColor = BrickColor.new("Really black")
130
t.BrickColor = BrickColor.new("Really black")
131
rl.BrickColor = BrickColor.new("Really black")
132
ll.BrickColor = BrickColor.new("Really black")
133
134
local hum = m:WaitForChild("Humanoid")
135
136
local normalanim = true
137
local animpose = "Idle"
138
local sine = 0
139
local RSnor = RS.C0
140
local LSnor = LS.C0
141
local RHnor = RH.C0
142
local LHnor = LH.C0
143
local necknor = neck.C0
144
local rootjnor = rootj.C0
145
146
char = m
147
148
local torso = Instance.new("CharacterMesh", game.Workspace)
149
torso.BodyPart = "Torso"
150
torso.MeshId = "27111894"
151
torso.Parent = char
152
 
153
local lleg = Instance.new("CharacterMesh", game.Workspace)
154
lleg.BodyPart = "LeftLeg"
155
lleg.MeshId = "27111857"
156
lleg.Parent = char
157
 
158
local rleg = Instance.new("CharacterMesh", game.Workspace)
159
rleg.BodyPart = "RightLeg"
160
rleg.MeshId = "27111882"
161
rleg.Parent = char
162
 
163
local larm = Instance.new("CharacterMesh", game.Workspace)
164
larm.BodyPart = "LeftArm"
165
larm.MeshId = "27111419"
166
larm.Parent = char
167
 
168
local rarm = Instance.new("CharacterMesh", game.Workspace)
169
rarm.BodyPart = "RightArm"
170
rarm.MeshId = "27111864"
171
rarm.Parent = char
172
173
174
local hair = Instance.new("Accessory")
175
hair.AttachmentPos = Vector3.new(0, -0.05, 0.1)
176
local ha = Instance.new("Part",hair)
177
ha.Name = "Handle"
178
ha.Size = Vector3.new(1, 1, 2)
179
local me = Instance.new("SpecialMesh", ha)
180
me.MeshId = "http://www.roblox.com/asset/?id=46834172"
181
me.TextureId = "http://www.roblox.com/asset/?id=47991609"
182
me.Scale = Vector3.new(1.05, 1.05, 1.05)
183
me.VertexColor = Vector3.new(1, 1, 1)
184
185
hair.Parent = m
186
187
local sh = Instance.new("Shirt",m)
188
sh.ShirtTemplate = "http://www.roblox.com/asset/?id=8561740"
189
sh.Name = "Shirt"
190
191
local tag = Instance.new("StringValue",m)
192
tag.Name = "Guest666"
193
tag.Value = owner.Name
194
195
local killing = false
196
197
-- Don't change.
198
while game:GetService("RunService").Heartbeat:Wait() do
199
	if normalanim then
200
		sine = sine + 1
201
	end
202
203
-- AI
204
------------------------
205
for i,v in pairs(workspace:GetChildren()) do
206
if v.Name == "Guest666" then
207
if not(v:FindFirstChildOfClass("Humanoid") == nil) then
208
if v:FindFirstChild("Guest666") ~= nil then
209
local h = v:FindFirstChildOfClass("Humanoid")
210
h.PlatformStand = false
211
if not(v:FindFirstChild("Torso") == nil) then
212
function onTouched(fire)
213
	local humn = fire.Parent:FindFirstChildOfClass("Humanoid")
214
	if humn then
215
if humn.Parent then
216
		for i,n in pairs (humn.Parent:GetChildren()) do
217
			if n.ClassName == "Part" then
218
if killing == false then
219
for i = 1,2 do
220
local p = Instance.new("Part",workspace)
221
p.CanCollide = false
222
p.Transparency = 0.5
223
p.Size = Vector3.new(1,1,1)
224
p.BrickColor = BrickColor.new("Really black")
225
p.Position = n.Position
226
p.Velocity = Vector3.new(math.random(-50,50),100,math.random(-50,50))
227
end
228
killing = true
229
n:Destroy()
230
wait(0.5)
231
killing = false
232
end
233
end
234
end
235
		end
236
	end
237
end
238
end
239
t.Touched:connect(onTouched)
240
241
s = v
242
local larm = s:FindFirstChild("Left Arm")
243
local rarm = s:FindFirstChild("Right Arm")
244
245
function findNearestTorso(pos)
246
local list = game.Workspace:children()
247
local torso = nil
248
local dist = 100000000000000000000000000000000000000000
249
local temp = nil
250
local human = nil
251
local temp2 = nil
252
for x = 1, #list do
253
temp2 = list[x]
254
if (temp2.className == "Model") and (temp2 ~= s) then
255
temp = temp2:FindFirstChild("Head")
256
h = temp2:FindFirstChildOfClass("Humanoid")
257
if (temp ~= nil) and (h ~= nil) and (h.Health > 0) then
258
s.Humanoid.WalkSpeed = 15
259
if (temp.Position - pos).magnitude < dist then
260
torso = temp
261
dist = (temp.Position - pos).magnitude
262
end
263
end
264
end
265
end
266
return torso
267
end
268
269
local antibug = s:FindFirstChild("Torso")
270
if antibug ~= nil then
271
local target = findNearestTorso(antibug.Position)
272
if target ~= nil then
273
s.Humanoid:MoveTo(target.Position, target)
274
s.Humanoid.WalkSpeed = 15
275
end
276
end
277
end
278
end
279
end
280
end
281
------------------------
282
283
hum.Health = 9999999999999999
284
285
286
	local touchfloor = workspace:FindPartOnRay(Ray.new(char.HumanoidRootPart.CFrame.Position, ((CFrame.new(char.HumanoidRootPart.Position, char.HumanoidRootPart.Position - Vector3.new(0, 1, 0))).LookVector).Unit * 4), char)
287
	if char.HumanoidRootPart.Velocity.Magnitude > 1 and touchfloor then
288
		animpose = "Walking"
289
	elseif char.HumanoidRootPart.Velocity.Y > 0.5 and touchfloor == nil then
290
		animpose = "Jumping"
291
	elseif char.HumanoidRootPart.Velocity.Y < 0.5 and touchfloor == nil then
292
		animpose = "Falling"
293
	else
294
		animpose = "Idle"
295
	end
296
	if animpose == "Idle" and normalanim then
297
                rootj.C0 = rootj.C0:Lerp(rootjnor, 0.15)
298
                RS.C0 = RS.C0:Lerp(RSnor, 0.15)
299
                LS.C0 = LS.C0:Lerp(LSnor, 0.15)
300
                RH.C0 = RH.C0:Lerp(RHnor, 0.15)
301
                LH.C0 = LH.C0:Lerp(LHnor, 0.15)
302
	elseif animpose == "Walking" and normalanim then
303
                rootj.C0 = rootj.C0:Lerp(rootjnor, 0.15)
304
        RS.C0 = RS.C0:Lerp(RSnor * CFrame.Angles(0, 0, math.sin(sine / 5)), 0.1) - Vector3.new(0, rootj.C0.Position.Y / 20, 0)
305
306
        LS.C0 = LS.C0:Lerp(LSnor * CFrame.Angles(0, 0, math.sin(sine / 5)), 0.1) - Vector3.new(0, rootj.C0.Position.Y / 20, 0)
307
308
        RH.C0 = RH.C0:Lerp(RHnor * CFrame.Angles(0, 0, math.sin(sine / 5)), 0.1) - Vector3.new(0, rootj.C0.Position.Y / 20, 0)
309
310
        LH.C0 = LH.C0:Lerp(LHnor * CFrame.Angles(0, 0, math.sin(sine / 5)), 0.1) - Vector3.new(0, rootj.C0.Position.Y / 20, 0)
311
	elseif animpose == "Jumping" and normalanim then
312
        rootj.C0 = rootj.C0:Lerp(rootjnor * CFrame.Angles(-0.5, 0, 0), 0.15)
313
        RS.C0 = RS.C0:Lerp(RSnor * CFrame.Angles(-0.3, 0, 0), 0.14)
314
        LS.C0 = LS.C0:Lerp(LSnor * CFrame.Angles(-0.3, 0, 0), 0.14)
315
        RH.C0 = RH.C0:Lerp(RHnor, 0.15)
316
        LH.C0 = LH.C0:Lerp(LHnor, 0.15)
317
	elseif animpose == "Falling" and normalanim then
318
        rootj.C0 = rootj.C0:Lerp(rootjnor * CFrame.Angles(0.5, 0, 0), 0.15)
319
        RS.C0 = RS.C0:Lerp(RSnor * CFrame.Angles(-0.6, 0, 0), 0.14)
320
        LS.C0 = LS.C0:Lerp(LSnor * CFrame.Angles(-0.6, 0, 0), 0.14)
321
        RH.C0 = RH.C0:Lerp(RHnor * CFrame.Angles(-0.3, 0, 0), 0.10)
322
        LH.C0 = LH.C0:Lerp(LHnor * CFrame.Angles(-0.3, 0, 0), 0.10)
323
	end
324
end