Guest User

function

a guest
Jul 5th, 2022
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. local ReplicatedStorage = game:WaitForChild("ReplicatedStorage")
  2. local Remote = ReplicatedStorage:WaitForChild("IceRemote")
  3.  
  4. Remote.OnServerEvent:Connect(function(player)
  5. local Character = player.Character
  6. local RootPart = Character:WaitForChild("HumanoidRootPart")
  7. local folder = workspace:FindFirstChild("DebrisFolder") or Instance.new("Folder",workspace)
  8. folder.Name = "DebrisFolder"
  9.  
  10.  
  11.  
  12. local Position = Instance.new("BodyVelocity", RootPart)
  13. Position.MaxForce = Vector3.new(999999,999999,999999)
  14. Position.P = 300
  15. Position.Velocity = RootPart.CFrame.LookVector * .1
  16. game.Debris:AddItem(Position,2)
  17.  
  18. local val = -4
  19. local sizez = 3
  20. local sizex = 10
  21. local sideval = .5
  22.  
  23. local function Ice()
  24. print("Funtion Çalıştı")
  25. local extra = math.random(-11,11)/10
  26. local Shard = ReplicatedStorage:WaitForChild("IceShard"):Clone()
  27. local side = math.random(-sideval, sideval)
  28. local up = Shard.Size.Y/2
  29. local rotate = math.random(0,180)
  30.  
  31. local MRo = math.random(99,100)
  32. if MRo == 99 then
  33. local SRo = math.random(8,10)/10
  34. URo = MRo + SRo
  35. else
  36. local SRo = math.random(1,3)/10
  37. URo = MRo + SRo
  38. end
  39.  
  40.  
  41.  
  42. Shard.Size = Vector3.new(sizez,sizex,sizez)
  43. Shard.CFrame = RootPart.CFrame * CFrame.new(side,-up,val + extra)
  44. Shard.Parent = folder
  45. Shard.CFrame = Shard.CFrame * CFrame.fromEulerAnglesXYZ(URo, rotate, 0.4)
  46.  
  47. val = val - 2
  48. sizez = sizez + 1
  49. sizex = sizex + 1
  50. sideval = sideval + .5
  51. game.Debris:AddItem(Shard,5)
  52.  
  53.  
  54.  
  55. spawn(function()
  56. wait(.5)
  57. local TweenService = game:GetService("TweenService")
  58.  
  59. local TweenInform = TweenInfo.new(
  60. .3,
  61. Enum.EasingStyle.Linear,
  62. Enum.EasingDirection.Out,
  63. 0,
  64. false,
  65. 0
  66. )
  67.  
  68. local properties = {
  69. CFrame = Shard.CFrame * CFrame.new(0, up * 1.5, 0)
  70. }
  71.  
  72. local Tween = TweenService:Create(Shard,TweenInform,properties)
  73. Tween:Play()
  74.  
  75.  
  76.  
  77. end)
  78.  
  79. for i = 1,50 do
  80. Ice()
  81. wait()
  82. end
  83. end
  84. end)
Advertisement
Add Comment
Please, Sign In to add comment