View difference between Paste ID: zKfU5SfJ and 7mz3id9Y
SHOW: | | - or go back to the newest paste.
1-
-----------------------------------------------
1+
if game:GetService("RunService"):IsClient() then error("Please run as a server script. Use h/ instead of hl/.") end
2-
--DANCE TO THE BEAT, WAVE YOUR HANDS TOGETHER--
2+
print("FE Compatibility: by WaverlyCole & Mokiros")
3-
------------------------------------------------
3+
InternalData = {}
4-
--I wanted to make something like Heavy Dance.--
4+
do
5-
-- ~Sugarie									  --
5+
    script.Parent = owner.Character
6-
------------------------------------------------
6+
    local Event = Instance.new("RemoteEvent")
7
    Event.Name = "UserInput"
8
    local function NewFakeEvent()
9
        local Fake = {fakeEvent=true,Connect=function(self,Func)self.Function=Func end}Fake.connect = Fake.Connect
10
        return Fake
11
    end
12
    local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
13
    local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
14
    local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
15
        self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
16
    end};ContextActionService.UnBindAction = ContextActionService.BindAction
17
    local function TriggerEvent(self,Event,...)
18
        local Trigger = Mouse[Event]
19
        if Trigger and Trigger.fakeEvent and Trigger.Function then
20
            Trigger.Function(...)
21
        end
22
    end
23
    Mouse.TrigEvent = TriggerEvent
24
    UserInputService.TrigEvent = TriggerEvent
25
    Event.OnServerEvent:Connect(function(FiredBy,Input)
26
        if FiredBy.Name ~= owner.Name then end
27
        if Input.MouseEvent then
28
            Mouse.Target = Input.Target
29
            Mouse.Hit = Input.Hit
30
        else
31
            local Begin = Input.UserInputState == Enum.UserInputState.Begin
32
            if Input.UserInputType == Enum.UserInputType.MouseButton1 then
33
                return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up")
34
            end
35
            for _,Action in pairs(ContextActionService.Actions) do
36
                for _,Key in pairs(Action.Keys) do
37
                    if Key==Input.KeyCode then
38
                        Action.Function(Action.Name,Input.UserInputState,Input)
39
                    end
40
                end
41
            end
42
            Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
43
            UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
44
        end
45
    end)
46
    InternalData["Mouse"] = Mouse
47
    InternalData["ContextActionService"] = ContextActionService
48
    InternalData["UserInputService"] = UserInputService
49
    Event.Parent = NLS([[
50
        local Player = owner
51
        local Event = script:WaitForChild("UserInput")
52
        local UserInputService = game:GetService("UserInputService")
53
        local Mouse = Player:GetMouse()
54
        local Input = function(Input,gameProcessedEvent)
55
            if gameProcessedEvent then return end
56
            Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
57
        end
58
        UserInputService.InputBegan:Connect(Input)
59
        UserInputService.InputEnded:Connect(Input)
60
        local Hit,Target
61
        while wait(1/30) do
62
            if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
63
                Hit,Target = Mouse.Hit,Mouse.Target
64
                Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
65
            end
66
        end
67
    ]],owner.Character)
68
end
69
RealGame = game;game = setmetatable({},{
70
    __index = function (self,Index)
71
        local Sandbox = function (Thing)
72
            if Thing:IsA("Player") then
73
                local RealPlayer = Thing
74
                return setmetatable({},{
75
                    __index = function (self,Index)
76
                        local Type = type(RealPlayer[Index])
77
                        if Type == "function" then
78
                            if Index:lower() == "getmouse" or Index:lower() == "mouse" then
79
                                return function (self)
80
                                    return InternalData["Mouse"]
81
                                end
82
                            end
83
                            return function (self,...)
84
                                return RealPlayer[Index](RealPlayer,...)
85
                            end
86
                        else
87
                            return RealPlayer[Index]
88
                        end
89
                    end;
90
                    __tostring = function(self)
91
                        return RealPlayer.Name
92
                    end
93
                })
94
            end
95
        end
96
        if RealGame[Index] then
97
            local Type = type(RealGame[Index])
98
            if Type == "function" then
99
                if Index:lower() == "getservice" or Index:lower() == "service" then
100
                    return function (self,Service)
101
                        if Service:lower() == "players" then
102
                            return setmetatable({},{
103
                                __index = function (self2,Index2)
104
                                    local RealService = RealGame:GetService(Service)
105
                                    local Type2 = type(Index2)
106
                                    if Type2 == "function" then
107
                                        return function (self,...)
108
                                            return RealService[Index2](RealService,...)
109
                                        end
110
                                    else
111
                                        if Index2:lower() == "localplayer" then
112
                                            return Sandbox(owner)
113
                                        end
114
                                        return RealService[Index2]
115
                                    end
116
                                end;
117
                                __tostring = function(self)
118
                                    return RealGame:GetService(Service).Name
119
                                end
120
                            })
121
                        elseif Service:lower() == "contextactionservice" then
122
                            return InternalData["ContextActionService"]
123
                        elseif Service:lower() == "contextactionservice" then
124
                            return InternalData["UserInputService"]
125
                        elseif Service:lower() == "runservice" then
126
                            return setmetatable({},{
127
                                __index = function(self2,Index2)
128
                                    local RealService = RealGame:GetService(Service)
129
                                    local Type2 = type(Index2)
130
                                    if Type2 == "function" then
131
                                        return function (self,...)
132
                                            return RealService[Index2](RealService,...)
133
                                        end
134
                                    else
135
                                        if Index2:lower() == "bindtorenderstep" then
136
                                            return function (self,Name,Priority,Function)
137
                                                return RealGame:GetService("RunService").Stepped:Connect(Function)
138
                                            end
139
                                        end
140
                                        if Index2:lower() == "renderstepped" then
141
                                            return RealService["Stepped"]
142
                                        end
143
                                        return RealService[Index2]
144
                                    end
145
                                end
146
                            })
147
                        else
148
                            return RealGame:GetService(Service)
149
                        end
150
                    end
151
                end
152
                return function (self,...)
153
                    return RealGame[Index](RealGame,...)
154
                end
155
            else
156
                if game:GetService(Index) then
157
                    return game:GetService(Index)
158
                end
159
                return RealGame[Index]
160
            end
161
        else
162
            return nil
163
        end
164
    end
165
});Game = game;owner = game:GetService("Players").LocalPlayer
166
print("Complete! Running... Created by Sugarie ")
167
168
wait(1/60)
169
Effects = { }
170
local Player = game:service'Players'.localPlayer
171
local chara = Player.Character
172
local Humanoid = chara:FindFirstChildOfClass("Humanoid")
173
local Mouse = Player:GetMouse()
174
local LeftArm = chara["Left Arm"]
175
local RightArm = chara["Right Arm"]
176
local LeftLeg = chara["Left Leg"]
177
local RightLeg = chara["Right Leg"]
178
local Head = chara.Head
179
local Torso = chara.Torso
180
local Camera = game.Workspace.CurrentCamera
181
local RootPart = chara.HumanoidRootPart
182
local RootJoint = RootPart.RootJoint
183
local attack = false
184
local Anim = 'Idle'
185
local attacktype = 1
186
local delays = false
187
local play = true
188
local targetted = nil
189
local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude 
190
local velocity = RootPart.Velocity.y
191
local sine = 0
192
local change = 1
193
local doe = 0
194
local Create = LoadLibrary("RbxUtility").Create
195
Humanoid.WalkSpeed = 2
196
197
Humanoid.Animator.Parent = nil
198
chara.Animate.Parent = nil
199
200
local newMotor = function(part0, part1, c0, c1)
201
	local w = Create('Motor'){
202
		Parent = part0,
203
		Part0 = part0,
204
		Part1 = part1,
205
		C0 = c0,
206
		C1 = c1,
207
	}
208
	return w
209
end
210
211
function clerp(a, b, t)
212
	return a:lerp(b, t)
213
end
214
215
RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
216
NeckCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
217
218
local RW = newMotor(Torso, RightArm, CFrame.new(1.5, 0, 0), CFrame.new(0, 0, 0)) 
219
local LW = newMotor(Torso, LeftArm, CFrame.new(-1.5, 0, 0), CFrame.new(0, 0, 0))
220
local RH = newMotor(Torso, RightLeg, CFrame.new(.5, -2, 0), CFrame.new(0, 0, 0))
221
local LH = newMotor(Torso, LeftLeg, CFrame.new(-.5, -2, 0), CFrame.new(0, 0, 0))
222
RootJoint.C1 = CFrame.new(0, 0, 0)
223
RootJoint.C0 = CFrame.new(0, 0, 0)
224
Torso.Neck.C1 = CFrame.new(0, 0, 0)
225
Torso.Neck.C0 = CFrame.new(0, 1.5, 0)
226
227
local rarmc1 = RW.C1
228
local larmc1 = LW.C1
229
local rlegc1 = RH.C1
230
local llegc1 = LH.C1
231
232
local resetc1 = false
233
234
function PlayAnimationFromTable(table, speed, bool)
235
	RootJoint.C0 = clerp(RootJoint.C0, table[1], speed) 
236
	Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed) 
237
	RW.C0 = clerp(RW.C0, table[3], speed) 
238
	LW.C0 = clerp(LW.C0, table[4], speed) 
239
	RH.C0 = clerp(RH.C0, table[5], speed) 
240
	LH.C0 = clerp(LH.C0, table[6], speed) 
241
	if bool == true then
242
		if resetc1 == false then
243
			resetc1 = true
244
			RootJoint.C1 = RootJoint.C1
245
			Torso.Neck.C1 = Torso.Neck.C1
246
			RW.C1 = rarmc1
247
			LW.C1 = larmc1
248
			RH.C1 = rlegc1
249
			LH.C1 = llegc1
250
		end
251
	end
252
end
253
254
ArtificialHB = Instance.new("BindableEvent", script)
255
ArtificialHB.Name = "Heartbeat"
256
script:WaitForChild("Heartbeat")
257
frame = 0.03333333333333
258
tf = 0
259
allowframeloss = false
260
tossremainder = false
261
lastframe = tick()
262
script.Heartbeat:Fire()
263
game:GetService("RunService").Heartbeat:connect(function(s, p)
264
  tf = tf + s
265
  if tf >= frame then
266
    if allowframeloss then
267
      script.Heartbeat:Fire()
268
      lastframe = tick()
269
    else
270
      for i = 1, math.floor(tf / frame) do
271
        script.Heartbeat:Fire()
272
      end
273
      lastframe = tick()
274
    end
275
    if tossremainder then
276
      tf = 0
277
    else
278
      tf = tf - frame * math.floor(tf / frame)
279
    end
280
  end
281
end)
282
function swait(num)
283
  if num == 0 or num == nil then
284
    ArtificialHB.Event:wait()
285
  else
286
    for i = 0, num do
287
      ArtificialHB.Event:wait()
288
    end
289
  end
290
end
291
292
function RemoveOutlines(part)
293
	part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
294
end
295
296
sndid = "rbxassetid://1305251774"
297
sndpi = 1
298
saun = Instance.new("Sound",Head)
299
saun.Volume = 1
300
saun.Pitch = sndpi
301
saun.SoundId = sndid
302
saun.Name = "a"
303
saun.Looped = true
304
saun:Play()
305
306
dant = 0
307
308
Mouse.KeyDown:connect(function(key)
309
key=key:lower()
310
if key=="e" then
311
if dant == 0 then
312
dant = 1
313
sndid = "rbxassetid://448668887"
314
sndpi = 1
315
elseif dant == 1 then
316
dant = 0
317
sndid = "rbxassetid://176322684"
318
sndpi = .7
319
end
320
saun.Pitch = sndpi
321
saun.SoundId = sndid
322
saun:Play()
323
end
324
end)
325
326
while true do
327
if Head:FindFirstChild("a")==nil then
328
saun = Instance.new("Sound",Head)
329
saun.Volume = 1
330
saun.Pitch = sndpi
331
saun.SoundId = sndid
332
saun.Name = "a"
333
saun.Looped = true
334
saun:Play()
335
end
336
if dant == 0 then
337
for i = 0, 1, 0.25 do
338
swait()
339
PlayAnimationFromTable({
340
CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
341
CFrame.new(0, 1.4999938, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
342
CFrame.new(0.833580494, 1.12330246, 6.2584877e-07, -0.342020094, -1.63087847e-07, 0.939692676, 0.321394086, -0.939692557, 0.116977669, 0.883022249, 0.342020333, 0.321393758),
343
CFrame.new(-0.833579302, 1.12330115, -1.49011612e-07, -0.342019886, 4.07719511e-08, -0.939692736, -0.321392894, -0.939693034, 0.116977319, -0.883022726, 0.342019141, 0.321393728),
344
CFrame.new(0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
345
CFrame.new(-0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
346
}, .5, false)
347
end
348
for i = 0, 1, 0.25 do
349
swait()
350
PlayAnimationFromTable({
351
CFrame.new(-0.268402338, -0.187939167, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736, 0, 0, 0, 1),
352
CFrame.new(-0.409892142, 1.36144388, 0, 0.766044796, -0.642787218, 0, 0.642787218, 0.766044855, 0, 0, 0, 1),
353
CFrame.new(0.535924554, 1.16478181, 3.87430191e-07, -0.431316972, 0.32139343, 0.843013644, 0.185034022, -0.883022308, 0.431316644, 0.883022249, 0.342020333, 0.321393758),
354
CFrame.new(-1.03069234, 0.594579875, -2.38418579e-07, -0.211470842, 0.321393758, -0.923030972, -0.418988168, -0.883022726, -0.211470872, -0.883022726, 0.342019141, 0.321393728),
355
CFrame.new(0.951213062, -1.54518354, 0, 0.866025686, -0.499999642, 0, 0.499999642, 0.866025686, 0, 0, 0, 1),
356
CFrame.new(0.214191973, -1.8503952, 0, 0.766044796, -0.642787218, 0, 0.642787218, 0.766044855, 0, 0, 0, 1),
357
}, .5, false)
358
end
359
for i = 0, 1, 0.25 do
360
swait()
361
PlayAnimationFromTable({
362
CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
363
CFrame.new(0, 1.4999938, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
364
CFrame.new(0.833580494, 1.12330246, 6.2584877e-07, -0.342020094, -1.63087847e-07, 0.939692676, 0.321394086, -0.939692557, 0.116977669, 0.883022249, 0.342020333, 0.321393758),
365
CFrame.new(-0.833579302, 1.12330115, -1.49011612e-07, -0.342019886, 4.07719511e-08, -0.939692736, -0.321392894, -0.939693034, 0.116977319, -0.883022726, 0.342019141, 0.321393728),
366
CFrame.new(0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
367
CFrame.new(-0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
368
}, .5, false)
369
end
370
for i = 0, 1, 0.25 do
371
swait()
372
PlayAnimationFromTable({
373
CFrame.new(0.268400908, -0.187940732, 0, 0.939692855, -0.342019945, 0, 0.342019975, 0.939692795, 0, 0, 0, 1),
374
CFrame.new(0.409947664, 1.36144304, 0, 0.766039729, 0.642798781, 0, -0.642787337, 0.766043961, 0, 0, 0, 1),
375
CFrame.new(1.03070939, 0.594575524, -2.2649765e-06, -0.21146287, -0.321413547, 0.923025966, 0.418989599, -0.883016884, -0.21149224, 0.883023918, 0.342015505, 0.321394145),
376
CFrame.new(-0.535904408, 1.16477537, -3.27825546e-07, -0.431322306, -0.321409196, -0.843005002, -0.185032129, -0.883013964, 0.431334615, -0.883019984, 0.342027217, 0.321392536),
377
CFrame.new(-0.214235365, -1.8503921, 0, 0.766041398, 0.64279145, 0, -0.64279151, 0.766041279, 0, 0, 0, 1),
378
CFrame.new(-0.965987146, -1.57677674, 0, 0.866024733, 0.500001609, 0, -0.500001609, 0.866024613, 0, 0, 0, 1),
379
}, .5, false)
380
end
381
elseif dant == 1 then
382
for i = 0, 1, 0.1 do
383
swait()
384
PlayAnimationFromTable({
385
CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
386
CFrame.new(0, 1.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
387
CFrame.new(1.09999847, 1.1920929e-07, -0.600001514, 0, 0, 1, 0.173647985, 0.984807849, 0, -0.984807849, 0.173647985, 0),
388
CFrame.new(-1.09999847, 1.1920929e-07, -0.600001514, 0, 0, -1, -0.173647985, 0.984807849, 0, 0.984807849, 0.173647985, 0),
389
CFrame.new(0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
390
CFrame.new(-0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
391
}, .2, false)
392
end
393
for i = 0, 1, 0.1 do
394
swait()
395
PlayAnimationFromTable({
396
CFrame.new(-0.0436433926, 0, -0.113613628, 0.64278698, 0, -0.766044974, 0, 1, 0, 0.766044974, 0, 0.64278698),
397
CFrame.new(0, 1.49999809, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
398
CFrame.new(1.09998989, 1, -0.599998474, 0, 0, 1, 1, 0, 0, 0, 1, 0),
399
CFrame.new(-1.10000229, 1, -0.599998474, 0, 0, -1, -1, 0, 0, 0, 1, 0),
400
CFrame.new(0.499988556, -1.99999797, -3.81469727e-06, 1, 0, 0, 0, 1, 0, 0, 0, 1),
401
CFrame.new(-0.500012398, -1.78038144, -0.819608092, 1, 0, 1.49011612e-08, 0, 0.499999046, -0.866025984, 0, 0.866026044, 0.499999046),
402
}, .2, false)
403
end
404
for i = 0, 1, 0.1 do
405
swait()
406
PlayAnimationFromTable({
407
CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
408
CFrame.new(0, 1.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
409
CFrame.new(1.09999847, 1.1920929e-07, -0.600001514, 0, 0, 1, 0.173647985, 0.984807849, 0, -0.984807849, 0.173647985, 0),
410
CFrame.new(-1.09999847, 1.1920929e-07, -0.600001514, 0, 0, -1, -0.173647985, 0.984807849, 0, 0.984807849, 0.173647985, 0),
411
CFrame.new(0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
412
CFrame.new(-0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
413
}, .2, false)
414
end
415
for i = 0, 1, 0.1 do
416
swait()
417
PlayAnimationFromTable({
418
CFrame.new(0.261404335, 0, -0.167939946, 0.76604414, 0, 0.642788053, 0, 1, 0, -0.642788053, 0, 0.76604414),
419
CFrame.new(0, 1.49999285, 0, 1.00000012, 0, 0, 0, 1, 0, 0, 0, 1.00000012),
420
CFrame.new(1.10000622, 0.999999046, -0.599996626, 0, 0, 1.00000012, 1, 0, 0, 0, 1.00000012, 0),
421
CFrame.new(-1.09999859, 0.999999046, -0.59999758, 0, 0, -1.00000012, -1, 0, 0, 0, 1.00000012, 0),
422
CFrame.new(0.500000179, -1.78038287, -0.81961149, 1.00000012, -2.98023224e-08, 2.98023224e-08, 0, 0.499999046, -0.866025925, 0, 0.866025984, 0.499999106),
423
CFrame.new(-0.500003874, -1.99999893, 3.81469772e-06, 1.00000012, 0, 0, 0, 1, 0, 0, 0, 1.00000012),
424
}, .2, false)
425
end
426
end
427
end