Advertisement
TheUnknownDiscord

funnycube

Feb 16th, 2022 (edited)
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. local x,y,z = owner.Character.HumanoidRootPart.CFrame.X,owner.Character.HumanoidRootPart.CFrame.Y,owner.Character.HumanoidRootPart.CFrame.Z
  2. local tweens = {}
  3. function gaming(where,where2,where3,size,grid)
  4. coroutine.wrap(function()
  5. local lastcf = CFrame.new(where,where2,where3)
  6. local lastcf2 = CFrame.new(0,0,0)
  7. for i = 1, grid do
  8. wait()
  9. local p = Instance.new("SpawnLocation",script)
  10. p.Enabled = false
  11. p.Anchored = true
  12. p.CFrame = lastcf * CFrame.new(-size,0,0)
  13. p.Size = Vector3.new(0.005,0.005,0.005)
  14. lastcf = p.CFrame
  15. lastcf2 = lastcf
  16. local tweenService = game:GetService("TweenService")
  17. local object = p
  18. local tweenInfo = TweenInfo.new(0.25,Enum.EasingStyle.Elastic,Enum.EasingDirection.InOut,-1,true,0.15)
  19. local goal = {}
  20. goal.Size = Vector3.new(size,size,size)
  21. local tween = tweenService:Create(object, tweenInfo, goal)
  22. table.insert(tweens,tween)
  23. for i = 1, grid - 1 do
  24. wait()
  25. local p = Instance.new("SpawnLocation",script)
  26. p.Enabled = false
  27. p.Anchored = true
  28. p.Size = Vector3.new(0.005,0.005,0.005)
  29. p.CFrame = lastcf2 * CFrame.new(0,size,0)
  30. lastcf2 = p.CFrame
  31. local tweenService = game:GetService("TweenService")
  32. local object = p
  33. local tweenInfo = TweenInfo.new(0.25,Enum.EasingStyle.Elastic,Enum.EasingDirection.InOut,-1,true,0.15)
  34. local goal = {}
  35. goal.Size = Vector3.new(size,size,size)
  36. local tween = tweenService:Create(object, tweenInfo, goal)
  37. table.insert(tweens,tween)
  38. end
  39. end
  40. end)()
  41. end
  42. owner.Chatted:Connect(function(msg)
  43. if msg:sub(1,6) == "!Cube " then
  44. grid = msg:sub(6,#msg):split(",")[1]
  45. for i = 1, grid do
  46. wait()
  47. local size = msg:sub(6,#msg):split(",")[2]
  48. gaming(x,y,z + i * size,size,grid)
  49. end
  50. wait(1)
  51. for i,v in pairs(tweens) do
  52. wait()
  53. v:Play()
  54. end
  55. end
  56. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement