steveshatt Posted July 24, 2022 Share Posted July 24, 2022 (edited) Hey everyone, I made a cool script for block overlay to let you know where you place! It still has some minor bugs so I'll fix those soon, but for now enjoy! To my knowledge it doesn't cause lag. Original code made by me steveshat (ofc) Requirements: - SkBee - Skript import: org.bukkit.World options: color: pink function displayBlockOverlay(player: player, location: location): set {_point::1} to {_location} ~ vector(0.5, -0.5, 0.5) set {_point::2} to {_location} ~ vector(-0.5, -0.5, 0.5) set {_point::3} to {_location} ~ vector(-0.5, -0.5, -0.5) set {_point::4} to {_location} ~ vector(0.5, -0.5, -0.5) loop 2 times: loop 4 times: make 1 of dust using dustOption({@color}, 0.5) at getLineLocations(({_point::%loop-integer-2%} ~ {_offset}), (({_point::%loop-integer-2 + 1%} ? {_point::1}) ~ {_offset})) to {_player} if loop-integer-1 is 1: make 1 of dust using dustOption({@color}, 0.5) at getLineLocations(({_point::%loop-integer-2%}), ({_point::%loop-integer-2%} ~ vector(0,1,0))) to {_player} set {_offset} to vector(0,1,0) function getLineLocations(location1: location, location2: location, density: integer=10) :: locations: set {_vector} to vector between {_location1} and {_location2} add {_location1} to {_return::*} loop {_density} times: set vector length of {_vector} to loop-integer/{_density} * (distance between {_location1} and {_location2}) add ({_location1} ~ {_vector}) to {_return::*} return {_return::*} every tick: loop all players where [{blockoverlay::%input's uuid%} is set]: set {_rayTrace.Result} to (loop-player's world).rayTraceBlocks(location of loop-player's eyes, (vector from yaw (loop-player's yaw) and pitch (loop-player's pitch)), 5) set {_rayTrace.hitBlock} to {_rayTrace.Result}.getHitBlock() set {_rayTrace.hitBlockFace} to "%{_rayTrace.Result}.getHitBlockFace()%" if {_rayTrace.hitBlockFace} is "UP": set {_focusedArea} to vector(0,1,0) else if {_rayTrace.hitBlockFace} is "SOUTH": set {_focusedArea} to vector(0,0,1) else if {_rayTrace.hitBlockFace} is "NORTH": set {_focusedArea} to vector(0,0,-1) else if {_rayTrace.hitBlockFace} is "DOWN": set {_focusedArea} to vector(0,-1,0) else if {_rayTrace.hitBlockFace} is "EAST": set {_focusedArea} to vector(1,0,0) else if {_rayTrace.hitBlockFace} is "WEST": set {_focusedArea} to vector(-1,0,0) displayBlockOverlay(loop-player, ({_rayTrace.hitBlock} ~ {_focusedArea})) command /blockoverlay [<string="help">]: trigger: if arg-1 is "help": send "&6Block Overlay Help:" send "1. /blockoverlay off" send "2. /blockoverlay on" else if arg-1 is "on": set {blockoverlay::%player's uuid%} to true send "&aYou turned on the Block Overlay!" else if arg-1 is "off": delete {blockoverlay::%player's uuid%} send "&cYou turned off the Block Overlay!" else: player command "/blockoverlay" Fixed the particles to be client sided Edited July 26, 2022 by steveshatt New code using ray tracing + better line function Link to comment Share on other sites More sharing options...
skwiptasdf Posted July 25, 2022 Share Posted July 25, 2022 this is so epic now i know where all my blocks are going to be placed 1 Link to comment Share on other sites More sharing options...
skwiptasdf Posted July 25, 2022 Share Posted July 25, 2022 Placing has NEVER been easier! 1 Link to comment Share on other sites More sharing options...
skwiptasdf Posted July 25, 2022 Share Posted July 25, 2022 just look at where you'd like to place, and you'll see exactly where you'd like to place! 1 Link to comment Share on other sites More sharing options...
steveshatt Posted July 25, 2022 Author Share Posted July 25, 2022 23 minutes ago, skwiptasdf said: this is so epic now i know where all my blocks are going to be placed This is so true! Link to comment Share on other sites More sharing options...
skwiptasdf Posted July 25, 2022 Share Posted July 25, 2022 How did I place blocks before this?!?! Link to comment Share on other sites More sharing options...
steveshatt Posted July 25, 2022 Author Share Posted July 25, 2022 2 minutes ago, skwiptasdf said: How did I place blocks before this?!?! I was thinking the same thing! Link to comment Share on other sites More sharing options...
Enchanted_Reeses Posted July 25, 2022 Share Posted July 25, 2022 Fun Code, Not to glitchy as well 1 Just a skripter who likes to have fun I also think I'm pretty good at it PS my discord is Enchanted#3933 incase idk anything? Link to comment Share on other sites More sharing options...
DjDisaster Posted July 25, 2022 Share Posted July 25, 2022 (edited) Sub-Optimal, using vectors would achieve a greater performance. Find example attached if curious.https://pastebin.com/wwF9GM5B Edited July 25, 2022 by DjDisaster Link to comment Share on other sites More sharing options...
skwiptasdf Posted July 25, 2022 Share Posted July 25, 2022 (edited) 5 minutes ago, DjDisaster said: Sub-Optimal, using vectors would achieve a greater performance. Find example attached if curious.https://pastebin.com/SBkq2epD i have never seen more sub-optimal code than whatever obfuscated nonsense that pastebin contains. Don't insult Block Overlay Skript By steveshatt again. Edited July 25, 2022 by skwiptasdf idk if i can swear Link to comment Share on other sites More sharing options...
DjDisaster Posted July 25, 2022 Share Posted July 25, 2022 (edited) 3 minutes ago, skwiptasdf said: i have never seen more sub-optimal code than whatever obfuscated nonsense that pastebin contains. Don't insult Block Overlay Skript By steveshatt again. Would you please explain any inquiries or issues with the scripts functionality please? If not then I expect for there to be no argument on this being better. Changes in the one I posted: More optimised Code More configurable Neater Edited July 25, 2022 by DjDisaster Link to comment Share on other sites More sharing options...
skwiptasdf Posted July 25, 2022 Share Posted July 25, 2022 Just now, DjDisaster said: Would you please explain any inquiries or issues with the scripts functionality please? If not then I expect for there to be no argument on this being better. well there's too many ~s, *s, _s and {s, and i cant understand it. i hate it so delete it Link to comment Share on other sites More sharing options...
DjDisaster Posted July 25, 2022 Share Posted July 25, 2022 (edited) 5 minutes ago, skwiptasdf said: well there's too many ~s, *s, _s and {s, and i cant understand it. i hate it so delete it {_s} is literally just 0.5 ~s does not appear Unless you have any functionality errors I see no such problem with the script I have posted. Edited July 25, 2022 by DjDisaster Link to comment Share on other sites More sharing options...
skwiptasdf Posted July 25, 2022 Share Posted July 25, 2022 2 minutes ago, DjDisaster said: {_s} is literally just 0.5 ~s does not appear Unless you have any functionality errors I see no such problem with the script I have posted.FIND ATTACHED RELEVENT MATERIAL I appreciate the relevant material that you attached, and to counter i give you my relevant material. Link to comment Share on other sites More sharing options...
DjDisaster Posted July 25, 2022 Share Posted July 25, 2022 13 minutes ago, skwiptasdf said: I appreciate the relevant material that you attached, and to counter i give you my relevant material. To counter such evidence I must say that Devil.Sk is A. No proof to be me B. The skript works, the message was edited about 20 minutes ago C. There is no proof it is not superior Thank you for taking your time to read this, Love you, DjDisaster Link to comment Share on other sites More sharing options...
skwiptasdf Posted July 25, 2022 Share Posted July 25, 2022 3 minutes ago, DjDisaster said: To counter such evidence I must say that Devil.Sk is A. No proof to be me B. The skript works, the message was edited about 20 minutes ago C. There is no proof it is not superior Thank you for taking your time to read this, Love you, DjDisaster I counteract your evidence by disabling Devil.sk. If you would now please delete your profile. Lots of love, skript lord (knighted by gigi) Link to comment Share on other sites More sharing options...
DjDisaster Posted July 25, 2022 Share Posted July 25, 2022 The skript lord is owned by thee Now stop arguing or you'll end in a tree. I don't want to fight; It would leave you in to much fright. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now