Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local r = game:service("RunService");
- local nextTime = 0
- local vx = 0
- local vz = 2
- local head = script.Parent
- local poopCount = 0
- function bounce()
- head.Velocity = Vector3.new(math.random(40)-20,math.random(100),math.random(40)-20)
- end
- function gobble(part)
- if (part.Name~="Base") and (part.Name~="Poop") then
- part.Parent = nil
- poopCount = poopCount + 1
- end
- bounce()
- end
- head.Touched:connect(gobble)
- function move(time)
- -- Reduce RotVelocity
- local v = head.RotVelocity
- head.RotVelocity = Vector3.new(v.x/2,v.y/2,v.z/2)
- -- Poop
- if poopCount>0 then
- local poop = Instance.new("Part")
- local p = head.Position
- poop.Position = p
- head.Position = Vector3.new(p.x, p.y+2, p.z)
- poop.Size = Vector3.new(1,1,1)
- poop.BrickColor = BrickColor.new(192)
- poop.Name = "Poop"
- poop.Parent = head.Parent
- poopCount = poopCount - 1
- end
- end
- bounce()
- while head.Parent~=nil do
- time = r.Stepped:wait()
- local p = head.Position
- if p.x>=30 then
- head.Velocity = Vector3.new(-20, 20, 0)
- elseif p.x<=-30 then
- head.Velocity = Vector3.new(20, 20, 0)
- end
- if p.z>=30 then
- head.Velocity = Vector3.new(0, 20, -20)
- elseif p.z<=-30 then
- head.Velocity = Vector3.new(0, 20, 20)
- end
- if time > nextTime then
- move(time)
- nextTime = time + 0.1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement