View difference between Paste ID: 5zix2RHx and XkWpZFYh
SHOW: | | - or go back to the newest paste.
1
--just put this on the top of a script and boom 89% works
2
--note this does not work on big scripts
3
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
4
local Player,game,owner = owner,game
5
local RealPlayer = Player
6
do
7
    local rp = RealPlayer
8
    script.Parent = rp.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,Functions={},Connect=function(self,f)table.insert(self.Functions,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-
MaxGrow=8
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 then
34
            for _,f in pairs(t.Functions) do
35
                f(...)
36
            end
37
        end
38
    end
39
    m.TrigEvent = te
40
    UIS.TrigEvent = te
41
 
42
    Event.OnServerEvent:Connect(function(plr,io)
43
        if plr~=rp then return end
44
        m.Target = io.Target
45
        m.Hit = io.Hit
46
        if not io.isMouse then
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 Mouse = Player:GetMouse()
67
    local UIS = game:GetService("UserInputService")
68
    local input = function(io,a)
69
        if a then return end
70
        --Since InputObject is a client-side instance, we create and pass table instead
71
        Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
72
    end
73
    UIS.InputBegan:Connect(input)
74
    UIS.InputEnded:Connect(input)
75
 
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
 
86
    ----Sandboxed game object that allows the usage of client-side methods and services
87
    --Real game object
88
    local _rg = game
89
 
90
    --Metatable for fake service
91
    local fsmt = {
92
        __index = function(self,k)
93
            local s = rawget(self,"_RealService")
94
            if s then return s[k] end
95
        end,
96
        __newindex = function(self,k,v)
97
            local s = rawget(self,"_RealService")
98
            if s then s[k]=v end
99
        end,
100
        __call = function(self,...)
101
            local s = rawget(self,"_RealService")
102
            if s then return s(...) end
103
        end
104
    }
105
    local function FakeService(t,RealService)
106
        t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
107
        return setmetatable(t,fsmt)
108
    end
109
 
110
    --Fake game object
111
    local g = {
112
        GetService = function(self,s)
113
            return self[s]
114
        end,
115
        Players = FakeService({
116
            LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
117
        },"Players"),
118
        UserInputService = FakeService(UIS,"UserInputService"),
119
        ContextActionService = FakeService(CAS,"ContextActionService"),
120
    }
121
    rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
122
    g.service = g.GetService
123
   
124
    g.RunService = FakeService({
125
        RenderStepped = _rg:GetService("RunService").Heartbeat,
126
        BindToRenderStep = function(self,name,_,fun)
127
            self._btrs[name] = self.Heartbeat:Connect(fun)
128
        end,
129
        UnbindFromRenderStep = function(self,name)
130
            self._btrs[name]:Disconnect()
131
        end,
132
    },"RunService")
133
 
134
    setmetatable(g,{
135
        __index=function(self,s)
136
            return _rg:GetService(s) or typeof(_rg[s])=="function"
137
            and function(_,...)return _rg[s](_rg,...)end or _rg[s]
138
        end,
139
        __newindex = fsmt.__newindex,
140
        __call = fsmt.__call
141
    })
142
    --Changing owner to fake player object to support owner:GetMouse()
143
    game,owner = g,g.Players.LocalPlayer
144
end
145
 
146
 
147
148
--[[Salvo_Starly[Salvy].Thingy_2018.8]]--
149
--[[Project Name: R.U.N]]--
150
wait(.2)
151
plr=game.Players.LocalPlayer
152
chr=plr.Character
153
Head=chr.Head
154
Root=chr.HumanoidRootPart
155
Torso=chr.Torso
156
RArm=chr["Right Arm"]
157
LArm=chr["Left Arm"]
158
RLeg=chr["Right Leg"]
159
LLeg=chr["Left Leg"]
160
RJ=Root.RootJoint
161
Neck=Torso.Neck
162
LS=Torso["Left Shoulder"] 
163
LH=Torso["Left Hip"] 
164
RS=Torso["Right Shoulder"] 
165
RH=Torso["Right Hip"] 
166
hum=chr:FindFirstChildOfClass("Humanoid")
167
mouse=plr:GetMouse()
168
died=false
169
EatTime=110
170
Siz=8
171
BallMass=15000
172
SSpeed=1.5
173
Grow=8
174
MinGrow=3.5
175
MaxGrow=100
176
GlV=25000
177
178
create=LoadLibrary("RbxUtility").Create
179
180
chr.Animate:Remove()
181
hum.Animator:Remove()
182
183
function clerp(a,b,t)
184
return a:lerp(b,t)
185
end
186
187
local newMotor=function(name,p0,p1,c0,c1)
188
local w=Instance.new('Motor',p0)
189
w.Name=name
190
w.Part0=p0
191
w.Part1=p1
192
w.C0=c0
193
w.C1=c1
194
return w
195
end
196
for _,c in pairs(Torso:children()) do
197
if c:IsA("Motor") and c.Name~="Neck" then
198
c:Remove()
199
end
200
end
201
202
203
RJ.C0,RJ.C1=CFrame.new(0,0,0),CFrame.new(0,0,0)
204
Neck.C0,Neck.C1=CFrame.new(0,1.5,0),CFrame.new(0,0,0)
205
--[[RS.C0,RS.C1=CFrame.new(1.5,0,0),CFrame.new(0,0,0)
206
LS.C0,LS.C1=CFrame.new(-1.5,0,0),CFrame.new(0,0,0)
207
RH.C0,RH.C1=CFrame.new(.5,-2,0),CFrame.new(0,0,0)
208
LH.C0,LH.C1=CFrame.new(-.5,-2,0),CFrame.new(0,0,0)]]
209
local RS=newMotor("Right Shoulder",Torso, RArm, CFrame.new(1.5, 0, 0), CFrame.new(0, 0, 0)) 
210
local LS=newMotor("Left Shoulder",Torso, LArm, CFrame.new(-1.5, 0, 0), CFrame.new(0, 0, 0))
211
local RH=newMotor("Right Hip",Torso, RLeg, CFrame.new(.5, -2, 0), CFrame.new(0, 0, 0))
212
local LH=newMotor("Left Hip",Torso, LLeg, CFrame.new(-.5, -2, 0), CFrame.new(0, 0, 0))
213
214
function NoOutline(Part)
215
Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface=10,10,10,10,10,10
216
end
217
218
function rayCast(Position,Direction,Range,Ignore)
219
return game:service("Workspace"):FindPartOnRay(Ray.new(Position,Direction.unit*(Range or 999.999)),Ignore)
220
end
221
222
ArtificialHB=create("BindableEvent"){
223
Parent=script,
224
Name="Heartbeat"}
225
226
script:WaitForChild("Heartbeat")
227
228
frame=0.0166666666666666667
229
tf=0
230
allowframeloss=false
231
tossremainder=false
232
lastframe=tick()
233
script.Heartbeat:Fire()
234
235
game:GetService("RunService").Heartbeat:connect(function(s,p)
236
tf=tf+s
237
if tf >=frame then
238
if allowframeloss then
239
script.Heartbeat:Fire()
240
lastframe=tick()
241
else
242
for i=1,math.floor(tf/frame) do
243
script.Heartbeat:Fire()
244
end
245
lastframe=tick()
246
end
247
if tossremainder then
248
tf=0
249
else
250
tf=tf-frame*math.floor(tf/frame)
251
end
252
end
253
end)
254
255
function swait(num)
256
if num==0 or num==nil then
257
ArtificialHB.Event:wait()
258
else
259
for i=0,num do
260
ArtificialHB.Event:wait()
261
end
262
end
263
end
264
265
function parts(Par,name,size,color,mat,ref,tra)
266
local part=create("Part"){
267
Parent=Par,
268
Name=name,
269
Size=size,
270
CanCollide=false,
271
Anchored=false,
272
BrickColor=BrickColor.new(color),
273
Material=mat,
274
Reflectance=ref,
275
Transparency=tra}
276
--Position=Torso.Position}
277
NoOutline(part)
278
part:BreakJoints()
279
return part 
280
end
281
282
function meshs(Par,name,scale,mtype,id)
283
local mesh=create("SpecialMesh"){
284
Parent=Par,
285
Name=name,
286
Scale=scale,
287
MeshType=mtype}
288
if id~="" then
289
mesh.MeshId="rbxassetid://"..id
290
end
291
return mesh
292
end
293
294
function welds(Par,name,p0,p1,c0,c1)
295
local weld=create("Weld"){
296
Parent=Par,
297
Name=name,
298
Part0=p0,
299
Part1=p1,
300
C0=c0,
301
C1=c1}
302
return weld
303
end
304
305
function sounds(Par,id,vol,pit)
306
local sound=create("Sound"){
307
Parent=Par,
308
SoundId="rbxassetid://"..id,
309
Volume=vol,
310
PlaybackSpeed=pit,
311
MaxDistance=66666666}
312
sound:Play()
313-
if MaxGrow<30 then
313+
314
return sound
315
end
316
317
for _,v in pairs(chr:children()) do
318
if v:IsA("BasePart")then
319
v.Transparency=1
320
elseif v:IsA("Accessory")then
321
v.Handle.Transparency=1
322
end
323
end
324
325
if Head:findFirstChild("face").Parent~=nil then
326
Head:findFirstChild("face").Transparency=1
327
end
328
329
Infections={}
330
331
--extremely lazy to use parts()
332
i=create("Part"){
333
Parent=chr,
334
Color=Color3.new(math.random(0,1),math.random(0, 1),math.random(0, 1)),
335
Locked=true,
336
CFrame=Root.CFrame,
337
Shape=0,
338
Size=Vector3.new(8,8,8),
339
Transparency=0.3,
340
}
341
NoOutline(i)
342
343
Force=create("BodyForce"){
344
Parent=i}
345
346
Vepz=create("BodyVelocity"){
347
maxForce=Vector3.new(math.huge,0,math.huge),
348
P=10,
349
velocity=Vector3.new(0,0,0)}
350
351
Hin=create("Hint"){
352
Parent=workspace,
353
Text="Survive and kill the bawlz for win!"
354
}
355
356
357
iw=welds(i,"MainWeld",Root,i,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1))
358
359
360
sounds(chr,"2767085",1,1.5)
361
362
363
MainGui=create("ScreenGui"){
364
Name="RUNGui",
365
Parent=plr.PlayerGui,
366
DisplayOrder=5
367
}
368
369
SizeLabel=create("TextLabel"){
370
Parent=MainGui,
371
AnchorPoint=Vector2.new(.5,.5),
372
Position=UDim2.new(.5,0,.8,0),
373
Size=UDim2.new(.06,0,.08,0),
374
ZIndex=1,
375
Text="Bawlz Size:",
376
BackgroundColor3=BrickColor.new("Navy blue").Color,
377
TextColor3=i.BrickColor.Color,
378
BorderColor3=i.BrickColor.Color,
379
Font="SourceSans",
380
TextSize=18,
381
--TextScaled=true,
382
TextYAlignment="Top"
383
}
384
385
SizeN=create("TextLabel"){
386
Parent=SizeLabel,
387
AnchorPoint=Vector2.new(.5,.5),
388
Position=UDim2.new(.5,0,.5,0),
389
Size=UDim2.new(1,0,1,0),
390
ZIndex=2,
391
Text=Grow,
392
BackgroundTransparency=1,
393
TextColor3=i.BrickColor.Color,
394
Font="SourceSans",
395
TextSize=18,
396
--TextScaled=true,
397
TextYAlignment="Bottom"
398
}
399
400
MSizeN=create("TextLabel"){
401
Parent=SizeLabel,
402
AnchorPoint=Vector2.new(.5,.5),
403
Position=UDim2.new(.5,0,1,0),
404
Size=UDim2.new(1,0,1,0),
405
ZIndex=2,
406
Text="Max Size: "..MaxGrow,
407
BackgroundTransparency=1,
408
TextColor3=i.BrickColor.Color,
409
Font="SourceSans",
410
TextSize=18,
411
--TextScaled=true,
412
TextYAlignment="Bottom"
413
}
414
415
Infections[i]=true
416
417
local s=create("Sound"){
418
SoundId="rbxassetid://10722059",
419
Volume=1,
420
Parent=Root}
421
422
423
function Join(Part0, Part1)
424
local Connector=create("Weld"){
425
C0=Part0.CFrame:inverse(),
426
C1=Part1.CFrame:inverse(),
427
Part0=Part0,
428
Part1=Part1,
429
Parent=Part0}
430
coroutine.resume(coroutine.create(function()
431
while Part1.Parent~=nil do
432
swait()
433
Connector.Parent=Part0
434
Connector.Part0=Part0
435
Connector.Part1=Part1
436
end
437
Connector:Remove()
438
end))
439
return Connector
440
end
441
442
function Eat(part,ir,s)
443
part.CanCollide=false
444
part.Anchored=true
445
while (part.Position-ir.Position).magnitude>Siz/3 do
446
part.CanCollide=false
447
part:BreakJoints()
448
local c={part.CFrame:components()}
449
local v=part.Position+CFrame.new(part.Position,ir.Position).lookVector*SSpeed
450
c[1]=v.X
451
c[2]=v.Y
452
c[3]=v.Z
453
part.CFrame=CFrame.new(unpack(c))
454
swait()
455
end
456
s:Play()
457
local p=Join(ir,part)
458
part.Anchored=false
459
swait(EatTime)
460
if MaxGrow<100 then
461
MaxGrow=MaxGrow+.5
462
else
463
MaxGrow=30
464
end
465
if part.Parent~=nil then
466
part:Remove()
467
end
468
end
469
470
--Hit:IsDescendantOf
471
472
i.Touched:connect(function(Hit)
473
if not died then
474
if Hit:GetMass()<BallMass and not Infections[Hit] and not string.match(Hit.Name,"Base") and Hit.Parent.Name~=plr.Name and Hit.Parent.Parent.Name~=plr.Name then
475
Infections[Hit]=true
476
Eat(Hit,i,s)
477
end
478
end
479
end)
480
481
mov=false
482
mouse.Button1Down:connect(function()
483
if not died then
484
mov=true
485
coroutine.resume(coroutine.create(function()
486
while mov do
487
swait()
488
if i and Force then
489
local force=(CFrame.new(i.Position,mouse.Hit.p).lookVector*GlV)
490
i.BodyForce.force = Vector3.new(force.x,0,force.z)
491
else
492
Force=create("BodyForce"){
493
Parent=i}
494
end
495
end
496
if Force then
497
Force.force=Vector3.new(0, 0, 0)
498
end
499
end))
500
end
501
end)
502
503
mouse.Button1Up:connect(function()
504
mov=false
505
end)
506
507
mouse.KeyDown:connect(function(k)
508
k=k:lower()
509
--stop
510
if k=="q" and Vepz.Parent==nil then
511
Vepz.Parent=i
512
end
513
--jump
514
if not died then
515
if k=="f" then
516
local Veps=create("BodyVelocity"){
517
maxForce=Vector3.new(0,math.huge,0),
518
P=10,
519
velocity=Vector3.new(0,100,0),
520
Parent=i}
521
game:GetService("Debris"):AddItem(Veps,.1)
522
end
523
--taunt
524
if k=="t" then
525
sounds(Root,"13378571",1,.5)
526
end
527
--change size
528
if not mov then
529
if k=="z" then
530
if Grow<MaxGrow then
531
Grow=Grow+.5
532
GlV=GlV+2500
533
else
534
Grow=MaxGrow
535
end
536
elseif k=="x" then
537
if Grow>MinGrow then
538
Grow=Grow-.5
539
GlV=GlV-2500
540
else
541
Grow=MinGrow
542
end
543
end
544
--renew
545
if k=="r" then
546
i:Remove()
547
end
548
end
549
end
550
end)
551
552
mouse.KeyUp:connect(function(k)
553
k=k:lower()
554
if k=="q" and Vepz.Parent~=nil then
555
Vepz.Parent=nil
556
end
557
end)
558
559
hum.Died:connect(function()
560
died=true
561
workspace.CurrentCamera.CameraSubject=hum
562
game:GetService("Debris"):AddItem(Hin,.2)
563
sounds(chr,"15632562",1,1.2)
564
local info=TweenInfo.new(3,Enum.EasingStyle.Bounce,Enum.EasingDirection.Out,0,false)
565
local tween=game:GetService("TweenService"):Create(i,info,{Size=Vector3.new(18,18,18)})
566
tween:Play()
567
i.Anchored=true
568
for _,v in pairs(chr:children()) do
569
if v:IsA("BasePart")then
570
v.Anchored=true
571
elseif v:IsA("Accessory")then
572
v.Handle.Anchored=true
573
end
574
end
575
local Hint=create("Hint"){
576
Parent=workspace,
577
Text="All bawlz died!"
578
}
579
coroutine.resume(coroutine.create(function()
580
swait(170)
581
sounds(chr,"13114759",1,0.7)
582
Hint.Text="Game over!"
583
end))
584
game:GetService("Debris"):AddItem(Hint,5)
585
for si=0,1,.005 do
586
swait()
587
i.Transparency=si
588
end
589
--chr:Remove()
590
for _,v in pairs(chr:children()) do
591
if v.ClassName~="Sound" then
592
v:Remove()
593
end
594
end
595
end)
596
597
598
599
while not died do
600
swait()
601
if Hin.Parent==nil then
602
Hin=create("Hint"){
603
Parent=workspace,
604
Text="Survive and kill the bawlz for win!"}
605
end
606
607
if i.Parent==nil then
608
i=create("Part"){
609
Parent=chr,
610
Color=Color3.new(math.random(0,1),math.random(0, 1),math.random(0, 1)),
611
Locked=true,
612
CFrame=Root.CFrame,
613
Shape=0,
614
Size=Vector3.new(8,8,8),
615
Transparency=0.3,
616
}
617
NoOutline(i)
618
619
Force=create("BodyForce"){
620
Parent=i}
621
622
Vepz=create("BodyVelocity"){
623
maxForce=Vector3.new(math.huge,0,math.huge),
624
P=10,
625
velocity=Vector3.new(0,0,0)}
626
627
i.Touched:connect(function(Hit)
628
if not died then
629
if Hit:GetMass()<BallMass and not Infections[Hit] and not string.match(Hit.Name,"Base") and Hit.Parent.Name~=plr.Name and Hit.Parent.Parent.Name~=plr.Name then
630
Infections[Hit]=true
631
Eat(Hit,i,s)
632
end
633
end
634
end)
635
636
end
637
i.Size=Vector3.new(Grow,Grow,Grow)
638
iw.Parent=i
639
iw.Part0=Root
640
iw.Part1=i
641
iw.C0=CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
642
iw.C1=CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
643
644
SizeN.Text=Grow
645
MSizeN.Text="Max Size: "..MaxGrow
646
647
workspace.CurrentCamera.CameraSubject=i
648
hum.PlatformStand=true
649
Neck.C0=clerp(Neck.C0,CFrame.new(0,0,0),.4)
650
RS.C0=clerp(RS.C0,CFrame.new(0,0,0),.4)
651
LS.C0=clerp(LS.C0,CFrame.new(0,0,0),.4)
652
RH.C0=clerp(RH.C0,CFrame.new(0,0,0),.4)
653
LH.C0=clerp(LH.C0,CFrame.new(0,0,0),.4)
654
end