Advertisement
HenloMyDude

remotes are garbage :/

Nov 18th, 2019
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. plr = owner
  2. physics = true
  3. mouse = plr:GetMouse()
  4. char = plr.Character
  5. hum = char.Humanoid
  6. spd = hum.WalkSpeed
  7. tors = char.Torso
  8.  
  9. function Swait(number)
  10. if number == 0 or number == nil then
  11. game:GetService("RunService").Heartbeat:Wait()
  12. else
  13. for i = 1,number do
  14. game:GetService("RunService").Heartbeat:Wait()
  15. end
  16. end
  17. end
  18.  
  19. NewSound = function(p, id, pit, vol, loop)
  20. local Sound = Instance.new("Sound",p)
  21. Sound.Pitch = pit
  22. Sound.Volume = vol
  23. Sound.SoundId = "rbxassetid://" ..id
  24. Sound.Looped = loop
  25. Sound:Play()
  26. return Sound
  27. end
  28.  
  29. local remote = Instance.new("RemoteEvent",char)
  30. remote.Name = "hi"
  31. local song = Instance.new("Sound",tors)
  32. song.SoundId = "rbxassetid://1335315983"
  33. song.Volume = 10
  34. song.Looped = true
  35. song.Name = "oatmeal"
  36. song:Play()
  37. local client = NLS([[
  38. plr = owner
  39. char = plr.Character
  40. remote = char.hi
  41. song = char.Torso.oatmeal
  42. loud = song.PlaybackLoudness
  43.  
  44. function Swait(number)
  45. if number == 0 or number == nil then
  46. game:GetService("RunService").Heartbeat:Wait()
  47. else
  48. for i = 1,number do
  49. game:GetService("RunService").Heartbeat:Wait()
  50. end
  51. end
  52. end
  53.  
  54. while true do
  55. Swait()
  56. --remote:FireServer(char.Torso.CFrame * CFrame.new(0, -3, 0), song.PlaybackLoudness)
  57. remote:FireServer(song.PlaybackLoudness)
  58. end
  59. ]],char)
  60.  
  61. function cartrail(number)
  62. local p = Instance.new("Part",char)
  63. p.CFrame = tors.CFrame * CFrame.new(0, -3, 0)
  64. p.BrickColor = BrickColor.new("Black")
  65. p.Transparency = 0.5
  66. p.CanCollide = false
  67. p.Anchored = true
  68. p.Size = Vector3.new(0.5, number, hum.WalkSpeed - 14.75)
  69. p.Position = p.Position + Vector3.new(0, number / 2, 0)
  70. coroutine.resume(coroutine.create(function()
  71. wait(2)
  72. for i = 1,15 do
  73. Swait()
  74. p.Transparency = p.Transparency + 0.1
  75. end
  76. p:remove()
  77. end))
  78. end
  79.  
  80. remote.OnServerEvent:connect(cartrail)
  81.  
  82. while true do
  83. Swait()
  84. --cartrail(tors.CFrame * CFrame.new(0, -3, 0))
  85. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement