# -------------------------------------------------- # SkCylinder v. 1.0 # Skrypt na tworzenie cylindrów i platform # # by Kormic # -------------------------------------------------- function roundLocation(loc: location) :: location: set {_loc}'s x-loc to round({_loc}'s x-loc) set {_loc}'s y-loc to round({_loc}'s y-loc) set {_loc}'s z-loc to round({_loc}'s z-loc) return {_loc} function createPlatform(loc: location, size: integer, block: item): set {_loc1} and {_loc2} to {_loc} set {_loc1} to roundLocation({_loc1}) set {_loc2} to roundLocation({_loc2}) remove 1 from y-loc of {_loc1} and y-loc of {_loc2} add ({_size} / 2) to x-loc of {_loc1} and z-loc of {_loc1} remove (({_size} / 2 ) - 1) from x-loc of {_loc2} and z-loc of {_loc2} loop blocks within {_loc1} to {_loc2}: set loop-block to {_block} function drawCylinder(p: player, loc: location, r: integer, h: integer, hollow: boolean, block: item): set {_loc} to roundLocation({_loc}) add 0.5 to {_loc}'s x-loc and {_loc}'s y-loc and {_loc}'s z-loc loop {_h} times: loop all blocks in radius {_r} around {_loc}: if loop-block's y-loc is {_loc}'s y-loc: set loop-block to {_block} if {_hollow} is true: loop all blocks in radius ({_r} - 1) around {_loc}: if loop-block's y-loc is {_loc}'s y-loc: if loop-block is red wool: set loop-block to air add 1 to {_loc}'s y-loc if {_hollow} is false: teleport {_p} to {_loc} command /cylinder [] []: executable by: players trigger: drawCylinder(player, location of the player, arg 1, arg 2, arg 3, arg 4) command /platforma []: executable by: players trigger: createPlatform(location of the player, arg 1, arg 2)