Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x,y,z = owner.Character.HumanoidRootPart.CFrame.X,owner.Character.HumanoidRootPart.CFrame.Y,owner.Character.HumanoidRootPart.CFrame.Z
- local tweens = {}
- function gaming(where,where2,where3,size,grid)
- coroutine.wrap(function()
- local lastcf = CFrame.new(where,where2,where3)
- local lastcf2 = CFrame.new(0,0,0)
- for i = 1, grid do
- wait()
- local p = Instance.new("SpawnLocation",script)
- p.Enabled = false
- p.Anchored = true
- p.CFrame = lastcf * CFrame.new(-size,0,0)
- p.Size = Vector3.new(0.005,0.005,0.005)
- lastcf = p.CFrame
- lastcf2 = lastcf
- local tweenService = game:GetService("TweenService")
- local object = p
- local tweenInfo = TweenInfo.new(0.25,Enum.EasingStyle.Elastic,Enum.EasingDirection.InOut,-1,true,0.15)
- local goal = {}
- goal.Size = Vector3.new(size,size,size)
- local tween = tweenService:Create(object, tweenInfo, goal)
- table.insert(tweens,tween)
- for i = 1, grid - 1 do
- wait()
- local p = Instance.new("SpawnLocation",script)
- p.Enabled = false
- p.Anchored = true
- p.Size = Vector3.new(0.005,0.005,0.005)
- p.CFrame = lastcf2 * CFrame.new(0,size,0)
- lastcf2 = p.CFrame
- local tweenService = game:GetService("TweenService")
- local object = p
- local tweenInfo = TweenInfo.new(0.25,Enum.EasingStyle.Elastic,Enum.EasingDirection.InOut,-1,true,0.15)
- local goal = {}
- goal.Size = Vector3.new(size,size,size)
- local tween = tweenService:Create(object, tweenInfo, goal)
- table.insert(tweens,tween)
- end
- end
- end)()
- end
- owner.Chatted:Connect(function(msg)
- if msg:sub(1,6) == "!Cube " then
- grid = msg:sub(6,#msg):split(",")[1]
- for i = 1, grid do
- wait()
- local size = msg:sub(6,#msg):split(",")[2]
- gaming(x,y,z + i * size,size,grid)
- end
- wait(1)
- for i,v in pairs(tweens) do
- wait()
- v:Play()
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement