Make block go to player's targeted block

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Jan 28, 2017
23
1
0
53
Question: How do I make it so that the block goes to the player's targeted block. Especially, how do I set the speed at which it is pushed. I've tried around with vectors but can't seem to get it to work.
code_language.skript:
if {frost.meteor.casting.%player%} isn't set:
            set player's targeted block to ice
            set {frost.meteor.location.%player%} to location of player's targeted block
            set {frost.meteor.casting.%player%} to true
        else if {frost.meteor.casting.%player%} is true:
            spawn falling block of ice at {frost.meteor.location.%player%}
            push last spawned entity up with force 1
            set {_from} to vector of {frost.meteor.location.%player%}
            send "%{_from}%"
            set {_to} to vector of location of targeted block
            set {_vector} to {_to} -- {_from}
            send "%{_vector}%"
            send "%{_v1}%"

            #set velocity of last spawned entity to {_vector}
            push last spawned entity direction from {frost.meteor.location.%player%} to player's targeted block at speed {_vector}
            delete {frost.meteor.casting.%player%}
            delete {frost.meteor.location.%player%}
 
Status
Not open for further replies.