Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (on the message receive function)
- local seed = msg
- for i, pairs in mob(ents.mobs) do
- mob:move(seed..mob.id)
- end
- (in the mob entity)
- function self:load(x, y)
- --load shit here
- local moveDirection = 1
- local moveDistance = 0
- end
- function self:update(dt)
- local x, y = self:getPos()
- if moveDistance > 0 then
- --move in the direction specified
- moveDistance = moveDistance -1
- end
- self:setPos(x, y)
- end
- function self:move(seed)
- local isDoing = math.random(1, 2, seed)
- if isDoing == 1 then
- moveDirection = math.random(1, 360, seed)
- moveDistance = math.random(1, 100, seed)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement