Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local statelist = {
- ["top"] = rs.getInput("top"),
- ["front"] = rs.getInput("front"),
- ["left"] = rs.getInput("left"),
- ["right"] = rs.getInput("right"),
- ["back"] = rs.getInput("back"),
- ["bottom"] = rs.getInput("bottom"),
- }
- local function spawn()
- if commands.blockdata then
- -- User is on at least MineCraft 1.8, snapshot 14w02a.
- commands.exec("summon Skeleton ~0 ~1 ~0 {Equipment:[{id:bow,tag:{ench:[{id:48,lvl:4}]}},{},{},{},{id:iron_helmet}],CustomName:Turret,CustomNameVisible:0,Attributes:[{Name:generic.maxHealth,Base:2},{Name:generic.movementSpeed,Base:0.001},{Name:generic.followRange,Base:32}],PersistenceRequired:1}")
- else
- -- User is on something earlier.
- --commands.exec("summon Skeleton ~0 ~1 ~0 {Equipment:[{id:261,tag:{ench:[{id:48,lvl:4}]}},{},{},{} {id:306}],CustomName:Turret,CustomNameVisible:0,Attributes:[{Name:generic.maxHealth,Base:2},{Name:generic.movementSpeed,Base:0.001} {Name:generic.followRange,Base:32}],PersistenceRequired:1}")
- end
- end
- while(true) do
- local event = os.pullEvent("redstone")
- for side, state in pairs(statelist) do
- if rs.getInput(side) then
- spawn()
- end
- statelist[side] = rs.getInput(side)
- end
- --spawn()
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement