Idirina

Sonic Script

Jan 1st, 2018
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.61 KB | None | 0 0
  1. --services
  2. local debris = game:GetService("Debris")
  3. local chatservice = game:GetService("Chat")
  4.  
  5.  
  6.  
  7. --[[settings]]
  8.  
  9. --mode customization
  10. local opmultiplierws = 1.25
  11. local spdmultiplierws = 2
  12. local opmultiplierjp = 1
  13. local spdmultiplierjp = 1.25
  14.  
  15. --color
  16. local maincolor = BrickColor.new("Deep blue")
  17. local secondarycolor = BrickColor.new("Toothpaste")
  18. local flamecolor = BrickColor.new("Maroon")
  19.  
  20. --music
  21. local musicid = "rbxassetid://149573450"
  22. local runmusicid = "rbxassetid://283755374"
  23.  
  24. --flash effect
  25. local flashduration = 0
  26.  
  27.  
  28. --jump power
  29. local walkjp = 50
  30. local runjp = 70
  31.  
  32.  
  33. --walk speed
  34. local walkspd = 26
  35. local runspd = 100
  36.  
  37.  
  38. local spd = 16
  39. local jpower = 50
  40.  
  41.  
  42. --enables
  43. local running = false
  44. local autotarget = false
  45. local opmode = false
  46. local chatting = false
  47. local superspeed = false
  48.  
  49.  
  50. --script
  51. local player = game:GetService("Players").LocalPlayer
  52. local mouse = player:GetMouse()
  53. repeat
  54. wait()
  55. until player.Character
  56. local character = player.Character
  57. local humanoid = character:FindFirstChild("Humanoid")
  58. local torso = character:FindFirstChild("Torso")
  59. if not torso and not humanoid then
  60. print("Torso and humanoid not found")
  61. return
  62. elseif not torso then
  63. print("No torso found")
  64. return
  65. elseif not humanoid then
  66. print("No humanoid found")
  67. return
  68. end
  69.  
  70.  
  71. --text
  72. local bgui = Instance.new("BillboardGui",character)
  73. bgui.Size = UDim2.new(0,100,0,40)
  74. bgui.StudsOffset = Vector3.new(0,2,0)
  75. bgui.Adornee = character.Head
  76. local texty = Instance.new("TextLabel", bgui)
  77. texty.BackgroundTransparency = 1
  78. texty.BorderSizePixel = 0
  79. texty.Text = ""
  80. texty.Font = "Cartoon"
  81. texty.FontSize = "Size24"
  82. texty.TextStrokeTransparency = 0.7
  83. texty.TextStrokeColor3 = Color3.new(50,50,255)
  84. texty.TextColor3 = Color3.new(0,0,255)
  85. texty.Size = UDim2.new(1,0,0.5,0)
  86.  
  87. coroutine.resume(coroutine.create(function()
  88. while true do
  89. wait()
  90. texty.Position = UDim2.new((math.cos(tick() * 15) / 5), 0, math.sin(tick() * 15) / 5, 0)
  91. if not chatting then
  92. texty.Text = "-" ..player.Name.. "-"
  93. end
  94. end
  95. end))
  96.  
  97. player.Chatted:connect(function(chat)
  98. chatting = true
  99. chat = chatservice:FilterStringForBroadcast(chat, player)
  100. for i=1,string.len(chat) do
  101. texty.Text = string.sub(chat, 1, i)
  102. wait()
  103. end
  104. wait(2)
  105. chatting = false
  106. end)
  107.  
  108.  
  109.  
  110. --useful functions
  111.  
  112. local function randomize(value1, value2)
  113. math.randomseed(os.time())
  114. for i=1,10 do
  115. math.random(1,100)
  116. end
  117. local randomizeeebebebe = math.random(value1, value2)
  118. return randomizeeebebebe
  119. end
  120.  
  121.  
  122.  
  123. --attacking
  124. local function attak(thing, thinghumanoid, place)
  125.  
  126. local hiteffect = Instance.new("Part", thing)
  127. hiteffect.Name = "Hit Effect"
  128. if opmode then
  129. hiteffect.BrickColor = secondarycolor
  130. else
  131. hiteffect.BrickColor = maincolor
  132. end
  133. hiteffect.Material = Enum.Material.Neon
  134. hiteffect.Anchored = true
  135. hiteffect.CanCollide = false
  136. hiteffect.CFrame = CFrame.new(thing.Position)
  137. hiteffect.Size = Vector3.new()
  138. hiteffect.Transparency = 0
  139. hiteffect.Shape = "Ball"
  140.  
  141. if superspeed then
  142. thing.Velocity = thing.Velocity + ((thing.Position - place.Position).unit * 500)
  143. end
  144. if opmode then
  145. thinghumanoid.Parent:BreakJoints()
  146. thing.Velocity = thing.Velocity + ((thing.Position - place.Position).unit * 1000)
  147. hiteffect.Size = Vector3.new(25,25,25)
  148. debris:AddItem(thinghumanoid.Parent, 1)
  149. else
  150. thinghumanoid:TakeDamage(randomize(17,24))
  151. end
  152.  
  153. thing.Velocity = thing.Velocity + ((thing.Position - place.Position).unit * 100)
  154.  
  155. coroutine.resume(coroutine.create(function()
  156. local hitchange = Vector3.new(0,hiteffect.Transparency,0)
  157. for i=1,10 do
  158. hiteffect.Transparency = hitchange.Y
  159. hiteffect.Size = hiteffect.Size:lerp(Vector3.new(7,7,7), 0.05 * i)
  160. hitchange = hitchange:lerp(Vector3.new(0,1,0), 0.05 * i)
  161. if superspeed then
  162. hiteffect.Color = hiteffect.Color:lerp(flamecolor.Color, 0.1 * i)
  163. end
  164. wait()
  165. end
  166. hiteffect:Destroy()
  167. end))
  168. end
  169.  
  170. local function Attack(area, range, autorange)
  171. local searchrange = range
  172. local autosearch = autorange
  173. local htorso = nil
  174. local hhumanoid = nil
  175. local autotargethumanoid = nil
  176. local autotargettorso = nil
  177. for i,v in pairs(game.Workspace:GetChildren()) do
  178. local ttorso = v:FindFirstChild("Torso")
  179. if not ttorso then
  180. ttorso = v:FindFirstChild("UpperTorso")
  181. if not ttorso then
  182. ttorso = v:FindFirstChild("HumanoidRootPart")
  183. end
  184. end
  185. local thumanoid = v:FindFirstChild("Humanoid")
  186. if ttorso and thumanoid and v ~= character then
  187. if thumanoid.Health > 0 then
  188. local distaway = (area.Position - ttorso.Position).magnitude
  189.  
  190. if distaway < range then
  191. attak(ttorso, thumanoid, area)
  192. end
  193.  
  194. if distaway < range then
  195. htorso = ttorso
  196. hhumanoid = thumanoid
  197. searchrange = distaway
  198. end
  199. if distaway < autosearch then
  200. autotargettorso = ttorso
  201. autotargethumanoid = thumanoid
  202. autosearch = distaway
  203. end
  204. end
  205. end
  206. end
  207. if htorso and hhumanoid then
  208. if autotarget and autotargettorso and autotargethumanoid then
  209. if autotargethumanoid.Health > 0 then
  210. humanoid:MoveTo(autotargettorso.Position)
  211. torso.Velocity = torso.Velocity + (torso.CFrame.lookVector * 50)
  212. end
  213. end
  214. end
  215. end
  216.  
  217.  
  218.  
  219. --music
  220. local music = Instance.new("Sound", torso)
  221. music.SoundId = musicid
  222. music.Volume = 0 --default 0.5
  223. music.EmitterSize = 10 --default 10
  224. music.PlaybackSpeed = 1 --default 1
  225. music.Looped = true
  226.  
  227.  
  228.  
  229.  
  230. --INTRO
  231. music:Play()
  232. humanoid.WalkSpeed = 0
  233.  
  234. wait(1)
  235.  
  236. local effect = Instance.new("Part", character)
  237. effect.Name = "Effect"
  238. effect.BrickColor = maincolor
  239. effect.Material = Enum.Material.Neon
  240. effect.Anchored = true
  241. effect.CanCollide = false
  242. effect.CFrame = CFrame.new(torso.Position)
  243. effect.Size = Vector3.new(10,10,10)
  244. effect.Shape = "Ball"
  245.  
  246. for i=1,1 do
  247. local change = Vector3.new(0,1,0)
  248. for i=1,20 do
  249. effect.Size = effect.Size:lerp(Vector3.new(0,0,0), 0.03 * i)
  250. effect.Transparency = change.Y
  251. change = change:lerp(Vector3.new(0,0,0), 0.02 * i)
  252. music.Volume = change.Y / 2
  253. wait()
  254. end
  255.  
  256. change = Vector3.new(0,1,0)
  257. effect.Size = Vector3.new(10,10,10)
  258. for i=1,20 do
  259. effect.Size = effect.Size:lerp(Vector3.new(0,0,0), 0.03 * i)
  260. effect.Transparency = change.Y
  261. change = change:lerp(Vector3.new(0,0,0), 0.02 * i)
  262. music.Volume = change.Y / 2
  263. wait()
  264. end
  265.  
  266. change = Vector3.new(0,1,0)
  267. effect.Size = Vector3.new(10,10,10)
  268. for i=1,20 do
  269. effect.Size = effect.Size:lerp(Vector3.new(0,0,0), 0.03 * i)
  270. effect.Transparency = change.Y
  271. change = change:lerp(Vector3.new(0,0,0), 0.02 * i)
  272. music.Volume = change.Y / 2
  273. wait()
  274. end
  275.  
  276. change = Vector3.new(0,0,0)
  277. effect.Size = Vector3.new(0,0,0)
  278. for i=1,20 do
  279. effect.Size = effect.Size:lerp(Vector3.new(30,30,30), 0.03 * i)
  280. effect.Color = effect.Color:lerp(flamecolor.Color, 0.03 * i)
  281. effect.Transparency = change.Y
  282. change = change:lerp(Vector3.new(0,1,0), 0.02 * i)
  283. music.Volume = change.Y / 2
  284. wait()
  285. end
  286. music.Volume = 0.5
  287. effect:Destroy()
  288. end
  289.  
  290.  
  291.  
  292. --set humanoid stats
  293. coroutine.resume(coroutine.create(function()
  294. while true do
  295. wait()
  296. humanoid.PlatformStand = false
  297. humanoid.WalkSpeed = spd
  298. humanoid.JumpPower = jpower
  299. humanoid.MaxHealth = math.huge
  300. humanoid.Health = math.huge
  301. for i,v in pairs(character:GetChildren()) do
  302. if v:IsA("Part") then
  303. v.Anchored = false
  304. end
  305. end
  306. end
  307. end))
  308.  
  309.  
  310. --visual effect for running
  311. local function Effect()
  312. for i,v in pairs(character:GetChildren()) do
  313. if v:IsA("Part") then
  314. local shadow = v:Clone()
  315. shadow:ClearAllChildren()
  316. if v.Name == "Head" then
  317. shadow.Size = Vector3.new(1.25,1.25,1.25)
  318. end
  319. if opmode then
  320. shadow.BrickColor = secondarycolor
  321. else
  322. shadow.BrickColor = maincolor
  323. end
  324. shadow.CanCollide = false
  325. shadow.Anchored = true
  326. shadow.Material = Enum.Material.Neon
  327. shadow.Transparency = 0.5
  328. shadow.Parent = workspace
  329.  
  330. coroutine.resume(coroutine.create(function()
  331. wait(flashduration)
  332. local flash = Vector3.new(0,shadow.Transparency,0)
  333. for i=1,10 do
  334. wait()
  335. shadow.Transparency = flash.Y
  336. shadow.Size = shadow.Size:lerp(Vector3.new(), 0.05 * i)
  337. flash = flash:lerp(Vector3.new(0,1,0), 0.05 * i)
  338. if superspeed then
  339. shadow.Color = shadow.Color:lerp(flamecolor.Color, 0.2 * i)
  340. end
  341. end
  342. shadow:Destroy()
  343. end))
  344. end
  345. end
  346. end
  347.  
  348.  
  349.  
  350. --keys
  351. mouse.KeyDown:connect(function(key)
  352. local bytekey = key:byte()
  353. local skey = key:lower()
  354. if bytekey == 48 then --Shift
  355. running = true
  356. torso.Velocity = torso.Velocity + (torso.CFrame.lookVector * 100)
  357. end
  358. if skey == "z" then
  359. if autotarget then
  360. autotarget = false
  361. else
  362. autotarget = true
  363. end
  364. end
  365. if skey == "x" then
  366. if opmode then
  367. opmode = false
  368. runspd = runspd / opmultiplierws
  369. runjp = runjp / opmultiplierjp
  370. else
  371. opmode = true
  372. runspd = runspd * opmultiplierws
  373. runjp = runjp * opmultiplierjp
  374. end
  375. end
  376. if skey == "c" then
  377. if superspeed then
  378. superspeed = false
  379. runspd = runspd / spdmultiplierws
  380. runjp = runjp / spdmultiplierjp
  381. else
  382. superspeed = true
  383. runspd = runspd * spdmultiplierws
  384. runjp = runjp * spdmultiplierjp
  385. end
  386. end
  387. end)
  388.  
  389. mouse.KeyUp:connect(function(key)
  390. local bytekey = key:byte()
  391. local skey = key:lower()
  392. if bytekey == 48 then --Shift
  393. running = false
  394. end
  395. end)
  396.  
  397.  
  398.  
  399. --main
  400. while true do
  401. if not running then
  402. spd = walkspd
  403. jpower = walkjp
  404. music.SoundId = musicid
  405. else
  406. spd = runspd
  407. jpower = runjp
  408. music.SoundId = runmusicid
  409. if torso.Velocity.magnitude > 1 then
  410. Effect()
  411. Attack(torso, 10, 150)
  412. end
  413. end
  414. wait()
  415. end
Add Comment
Please, Sign In to add comment