Advertisement
sIendytubble

paint the town red berserk mode

Sep 1st, 2020 (edited)
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.09 KB | None | 0 0
  1. -- paint the town red beserk mode
  2. -- basically this script gives you the ability of
  3. -- smashing people into bloody organs and testicles
  4. -- and stopping time
  5. --i liked the idea of making this so i did
  6. --it took me 2 hours because the gore thing didnt work right so
  7. -- enjoy i guess
  8. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  9. local Player,game,owner = owner,game
  10. local RealPlayer = Player
  11. do
  12. print("FE Compatibility code by Mokiros")
  13. local rp = RealPlayer
  14. script.Parent = rp.Character
  15.  
  16. --RemoteEvent for communicating
  17. local Event = Instance.new("RemoteEvent")
  18. Event.Name = "UserInput_Event"
  19.  
  20. --Fake event to make stuff like Mouse.KeyDown work
  21. local function fakeEvent()
  22. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  23. t.connect = t.Connect
  24. return t
  25. end
  26.  
  27. --Creating fake input objects with fake variables
  28. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  29. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  30. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  31. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  32. end}
  33. --Merged 2 functions into one by checking amount of arguments
  34. CAS.UnbindAction = CAS.BindAction
  35.  
  36. --This function will trigger the events that have been :Connect()'ed
  37. local function te(self,ev,...)
  38. local t = m[ev]
  39. if t and t._fakeEvent then
  40. for _,f in pairs(t.Functions) do
  41. f(...)
  42. end
  43. end
  44. end
  45. m.TrigEvent = te
  46. UIS.TrigEvent = te
  47.  
  48. Event.OnServerEvent:Connect(function(plr,io)
  49. if plr~=rp then return end
  50. m.Target = io.Target
  51. m.Hit = io.Hit
  52. if not io.isMouse then
  53. local b = io.UserInputState == Enum.UserInputState.Begin
  54. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  55. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  56. end
  57. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  58. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  59. end
  60. for _,t in pairs(CAS.Actions) do
  61. for _,k in pairs(t.Keys) do
  62. if k==io.KeyCode then
  63. t.Function(t.Name,io.UserInputState,io)
  64. end
  65. end
  66. end
  67. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  68. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  69. end
  70. end)
  71. Event.Parent = NLS([==[
  72. local Player = game:GetService("Players").LocalPlayer
  73. local Event = script:WaitForChild("UserInput_Event")
  74. local Mouse = Player:GetMouse()
  75. local UIS = game:GetService("UserInputService")
  76. local input = function(io,a)
  77. if a then return end
  78. --Since InputObject is a client-side instance, we create and pass table instead
  79. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  80. end
  81. UIS.InputBegan:Connect(input)
  82. UIS.InputEnded:Connect(input)
  83. local h,t
  84. --Give the server mouse data 30 times every second, but only if the values changed
  85. --If player is not moving their mouse, client won't fire events
  86. while wait(1/30) do
  87. if h~=Mouse.Hit or t~=Mouse.Target then
  88. h,t=Mouse.Hit,Mouse.Target
  89. Event:FireServer({isMouse=true,Target=t,Hit=h})
  90. end
  91. end]==],Player.Character)
  92.  
  93. ----Sandboxed game object that allows the usage of client-side methods and services
  94. --Real game object
  95. local _rg = game
  96.  
  97. --Metatable for fake service
  98. local fsmt = {
  99. __index = function(self,k)
  100. local s = rawget(self,"_RealService")
  101. if s then
  102. return typeof(s[k])=="function"
  103. and function(_,...)return s[k](s,...)end or s[k]
  104. end
  105. end,
  106. __newindex = function(self,k,v)
  107. local s = rawget(self,"_RealService")
  108. if s then s[k]=v end
  109. end
  110. }
  111. local function FakeService(t,RealService)
  112. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  113. return setmetatable(t,fsmt)
  114. end
  115.  
  116. --Fake game object
  117. local g = {
  118. GetService = function(self,s)
  119. return rawget(self,s) or _rg:GetService(s)
  120. end,
  121. Players = FakeService({
  122. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  123. },"Players"),
  124. UserInputService = FakeService(UIS,"UserInputService"),
  125. ContextActionService = FakeService(CAS,"ContextActionService"),
  126. RunService = FakeService({
  127. _btrs = {},
  128. RenderStepped = _rg:GetService("RunService").Heartbeat,
  129. BindToRenderStep = function(self,name,_,fun)
  130. self._btrs[name] = self.Heartbeat:Connect(fun)
  131. end,
  132. UnbindFromRenderStep = function(self,name)
  133. self._btrs[name]:Disconnect()
  134. end,
  135. },"RunService")
  136. }
  137. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  138. g.service = g.GetService
  139. FakeService(g,game)
  140. --Changing owner to fake player object to support owner:GetMouse()
  141. game,owner = g,g.Players.LocalPlayer
  142. end
  143. local list = {}
  144. local minimumsize = Vector3.new(0.6,0.6,0.6)
  145. local fragmentable = workspace
  146. gey = game.Players.LocalPlayer.Character
  147. for i,v in pairs(gey:GetDescendants()) do
  148. if v.ClassName == "Part" then
  149. a = Instance.new("IntValue",v)
  150. a.Name = "pleb"
  151. end
  152. end
  153. local surface_between_splitted_parts = 'SmoothNoOutlines'
  154. function fragmentate(cframe,size,color,explosion_position,explosion_blastradius,backsurface,bottomsurface,frontsurface,leftsurface,rightsurface,topsurface,transparency,reflectance,material,anchored,heck,ree,same)
  155. local xi = size.X >= minimumsize.X*(1+explosion_blastradius/16) and 2 or 1
  156. local yi = size.Y >= minimumsize.Y*(1+explosion_blastradius/16) and 2 or 1
  157. local zi = size.Z >= minimumsize.Z*(1+explosion_blastradius/16) and 2 or 1
  158. if xi == 1 and yi == 1 and zi == 1 or (cframe.p-explosion_position).magnitude > size.magnitude/2 + explosion_blastradius then
  159. if xi == 1 and yi == 1 and zi == 1 then return end
  160. local p = Instance.new("Part",fragmentable)
  161. --p.BrickColor = BrickColor.new("Carnation pink")
  162. p.FormFactor = "Custom"
  163. if heck then
  164. p.Anchored = anchored
  165. else
  166. p.Anchored = false
  167. end
  168. p.Size = size
  169. if p.Size == Vector3.new(1,2,1) then
  170. p.BrickColor = color
  171. else
  172. p.BrickColor = BrickColor.new("Carnation pink")
  173. end
  174. p.BackSurface = backsurface
  175. p.BottomSurface = bottomsurface
  176. p.FrontSurface = frontsurface
  177. p.LeftSurface = leftsurface
  178. p.RightSurface = rightsurface
  179. if heck ~= true or ree == true then
  180. local int = Instance.new('IntValue',p)
  181. int.Name = 'already broken u pleb'
  182. end
  183. p.TopSurface = topsurface
  184. if redmode and ree and same ~= true then
  185. spawn(function()
  186. repeat
  187. p.Color = Color3.new(1,0,0)
  188. p.Material = Enum.Material.Neon
  189. wait()
  190. until p.Color == Color3.new(1,0,0) and p.Material == Enum.Material.Neon
  191. end)
  192. end
  193. p.Transparency = transparency
  194. p.Material = material
  195. if heck ~= true or ree then
  196. game:GetService('Debris'):AddItem(p,10)
  197. end
  198. p.CFrame = cframe
  199. p.Reflectance = reflectance
  200. p:BreakJoints()
  201. return
  202. end
  203. local mody = math.random(-125,125)/1000
  204. for y = 1,yi do
  205. if math.random()> 0.5 then
  206. local modx = math.random(-125,125)/1000
  207. for x = 1,xi do
  208. local modz = math.random(-125,125)/1000
  209. for z = 1,zi do --offset = x/xi-0.75+modx)
  210. fragmentate(cframe*CFrame.new(size.X*(xi==1 and 0 or x/xi-0.75+modx),size.Y*(yi==1 and 0 or y/yi-0.75+mody),size.Z*(zi==1 and 0 or z/zi-0.75+modz)),
  211. Vector3.new(xi == 2 and size.X*(1-2*math.abs(x/xi-0.75+modx)) or size.X,yi == 2 and size.Y*(1-2*math.abs(y/yi-0.75+mody)) or size.Y,
  212. zi == 2 and size.Z*(1-2*math.abs(z/zi-0.75+modz)) or size.Z),color,explosion_position,explosion_blastradius,
  213. z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
  214. z==2 and surface_between_splitted_parts or frontsurface,x==2 and surface_between_splitted_parts or leftsurface,x~=xi and surface_between_splitted_parts or rightsurface,
  215. y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance,material,anchored,heck,ree,same)
  216. end
  217.  
  218. end
  219. else
  220. local modz = math.random(-125,125)/1000
  221. for z = 1,zi do
  222. local modx = math.random(-125,125)/1000
  223. for x = 1,xi do
  224. fragmentate(cframe*CFrame.new(size.X*(xi==1 and 0 or x/xi-0.75+modx),size.Y*(yi==1 and 0 or y/yi-0.75+mody),size.Z*(zi==1 and 0 or z/zi-0.75+modz)),
  225. Vector3.new(xi == 2 and size.X*(1-2*math.abs(x/xi-0.75+modx)) or size.X,yi == 2 and size.Y*(1-2*math.abs(y/yi-0.75+mody)) or size.Y,
  226. zi == 2 and size.Z*(1-2*math.abs(z/zi-0.75+modz)) or size.Z),color,explosion_position,explosion_blastradius,
  227. z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
  228. z==2 and surface_between_splitted_parts or frontsurface,x==2 and surface_between_splitted_parts or leftsurface,x~=xi and surface_between_splitted_parts or rightsurface,
  229. y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance,material,anchored,heck,ree,same)
  230. end
  231. end
  232. end
  233. end
  234. end
  235.  
  236. function start_fragmentation(position,radius,bigoof,smoloof,samecolor)
  237. if bigoof then
  238. workspace:FindFirstChildOfClass('Terrain'):FillBall(position,radius*2,Enum.Material.Air)
  239. end
  240. local search = Region3.new(position-Vector3.new(radius,radius,radius)*1.1,position+Vector3.new(radius,radius,radius)*1.1)
  241. repeat
  242. local finish = false
  243. local parts = workspace:FindPartsInRegion3WithIgnoreList(search,list,100)
  244. for i = 1,#parts do
  245. table.insert(list,1,parts[i])
  246. end
  247. finish = true
  248. until #parts < 100 and finish
  249. local t = tick()
  250. for i = 1,#list do
  251. local po = list[i]
  252. if po.Parent:FindFirstChild("Head") ~= nil and po ~= nil then
  253. if po:FindFirstChild('pleb') == nil then
  254. for i,p in pairs(po.Parent:GetChildren()) do
  255. if p.ClassName == "MeshPart" or p.ClassName == "Part" then
  256. fragmentate(p.CFrame,p.Size,p.BrickColor,position,radius,p.BackSurface,p.BottomSurface,p.FrontSurface,p.LeftSurface,p.RightSurface,p.TopSurface,p.Transparency,p.Reflectance,p.Material,p.Anchored,bigoof,smoloof,samecolor)
  257. end
  258. end
  259. end
  260. end
  261. end
  262. list = {}
  263. end
  264.  
  265. function firer(pos)
  266. BOOMA = Instance.new("Sound",pos)
  267. BOOMA.SoundId = "rbxassetid://429400881"
  268. BOOMA.Volume = 10
  269. BOOMA.PlaybackSpeed = 0.5
  270. BOOMA:Play()
  271. end
  272. function zaphit(hitpos)
  273. local exp = Instance.new('Explosion',workspace)
  274. exp.Position = hitpos
  275. exp.DestroyJointRadiusPercent = 0
  276. exp.BlastRadius = 1
  277. firer(char["Right Arm"])
  278. start_fragmentation(hitpos,7.5,true)
  279. exp.Hit:connect(function(hit)
  280. if hit.Parent and hit.Parent:FindFirstChildOfClass('Humanoid') then
  281. if hit.Parent ~= game.Players.LocalPlayer.Character then
  282. for i,v in pairs(hit.Parent:GetDescendants()) do
  283. if v:IsA('BasePart')then
  284. pcall(function()
  285. v.Parent = nil
  286. end)
  287. local backpr = minimumsize
  288. minimumsize = Vector3.new(0.6,0.6,0.6)
  289. start_fragmentation(v.Position,0.05,true,true)
  290. minimumsize = backpr
  291. end
  292. end
  293. end
  294. end
  295. end)
  296. end
  297. char = game.Players.LocalPlayer.Character
  298. RunService = game:GetService("RunService")
  299. Character = char
  300. VirtualBody = Character
  301. function blast(charg,waittime)
  302. coroutine.resume(coroutine.create(function()
  303. --charg.HumanoidRootPart:Destroy()
  304. firer(char["Right Arm"])
  305.  
  306. zaphit(charg.Head.Position)
  307. end))
  308. end
  309. char["Right Arm"].Touched:Connect(function(part)
  310. if part.Parent ~= workspace and part.Parent:FindFirstChildOfClass("Humanoid") then
  311. if aa == true then
  312. blast(part.Parent,0.3)
  313. end
  314. end
  315. end)
  316. player = game.Players.LocalPlayer
  317. char = player.Character
  318. b = CFrame.new(1.3,0.5,0) * CFrame.Angles(math.rad(70),math.rad(25),math.rad(25))
  319. a = CFrame.new(1.5,0.6,-1) * CFrame.Angles(math.rad(90),math.rad(45),math.rad(-20))
  320. swinging = false
  321. weld = Instance.new("Weld",char)
  322. weld.Part0 = char.Torso
  323. weld.Part1 = char["Right Arm"]
  324. weld.C0 = CFrame.new(1.5,0,0)
  325. aa = false
  326. bb = false
  327. mouse = player:GetMouse()
  328. mouse.Button1Down:Connect(function()
  329. if swinging == false then
  330. swinging = true
  331. bb = true
  332. wait(2)
  333. bb = false
  334. aa = true
  335. wait(2)
  336. bb = false
  337. aa = false
  338. swinging = false
  339. end
  340. end)
  341. game:GetService("RunService").Stepped:Connect(function()
  342. if aa == true then
  343. weld.Part1 = char["Right Arm"]
  344. weld.C0 = weld.C0:lerp(a,0.1)
  345. else
  346. --weld.Part1 = nil
  347. end
  348. if bb == true then
  349. workspace.Gravity = 10
  350. for i,v in pairs(workspace:GetDescendants()) do
  351. if v.ClassName == "Humanoid" then
  352. v.UseJumpPower = false
  353. v.WalkSpeed = 4
  354. end
  355. end
  356. for i,v in pairs(workspace:GetDescendants()) do
  357. if v.ClassName == "Sound" then
  358. v.PlaybackSpeed = 0.5
  359. end
  360. end
  361. weld.Part1 = char["Right Arm"]
  362. weld.C0 = weld.C0:lerp(b,0.09)
  363. elseif bb == false and aa == false then
  364. weld.Part1 = nil
  365. for i,v in pairs(workspace:GetDescendants()) do
  366. if v.ClassName == "Humanoid" then
  367. v.UseJumpPower = true
  368. v.WalkSpeed = 16
  369. end
  370. end
  371. for i,v in pairs(workspace:GetDescendants()) do
  372. if v.ClassName == "Sound" then
  373. v.PlaybackSpeed = 1
  374. end
  375. end
  376. workspace.Gravity = 196.2
  377. end
  378. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement