Watchdog

  • 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.

Normalguy

Active Member
Apr 19, 2018
98
0
0
24
Skript Version : Skript 2.1.1
Skript Author: Bensku
Minecraft Version: 1.8.8

Hi I want to make ncp fly around a player.
But I don’t know how to fly ncp in exact circle and I want to know how to make ncp click target player without attacking
 
Last edited:
code_language.skript:
command /circle:
    permission: o.o
    trigger:
        spawn an armor stand at player's location
        set {_a} to spawned armor stand
        set gravity of {_a} to false
        set {circle} to true
        set {_l} to player's location
        set {_radius} to 1
        set {_angle} to 20
        set {_rotation} to 180
        set {_current} to 0
        while {circle} is true:
            add {_angle} to {_current}
            set {_l} to {_location}
            add ((cos ({_rotation} / 180) * 3.14159265358979323846) * ((cos (({_current} / 180) * 3.14159265358979323846)) * {_radius})) to x-loc of {_l}
            add (sin ({_rotation} / 180) * 3.14159265358979323846) * ((cos (({_current} / 180) * 3.14159265358979323846)) * {_radius}) to y-loc of {_l}
            add (sin (({_current} / 180) * 3.14159265358979323846)) * {_radius} to z-loc of {_l}
            teleport {_a} to {_l}
            wait 1 tick
But you would need to calculate center of rotating entity because its like this:
[doublepost=1527238915,1527238651][/doublepost]
upload_2018-5-25_11-0-45.png

and you need it like this:
upload_2018-5-25_11-1-52.png

[doublepost=1527240048][/doublepost]and just change armor stand to npc.. or whatever you want..
and im not understand "I want to know how to make ncp click target player without attacking"...
do you want it like npc click certain, targeted player? with leftclick = damage, but you dont want damage?
or?
 
Can you put your actual Skript version? There's no way you're using 2.1.2 if you're using a version by bensku and the version is important because vanilla Skript had vector support added a while ago, so somebody could help you using vectors if you're on the correct version.
 
so.. use code which i already posed and just add there:

code_language.skript:
make citizen %id% attack player

on damage:
    if victim is player:
        if attacker is npc:
            cancel event
but i dont know what is your request.. what is your full code? what do you want to create? why do you want to click player without attacking him? i cant help you propertly when i dont know it...
 
You answered my whole questions. Thank you very much. And Where did you know
code_language.skript:
            add ((cos ({_rotation} / 180) * 3.14159265358979323846) * ((cos (({_current} / 180) * 3.14159265358979323846)) * {_radius})) to x-loc of {_l}
            add (sin ({_rotation} / 180) * 3.14159265358979323846) * ((cos (({_current} / 180) * 3.14159265358979323846)) * {_radius}) to y-loc of {_l}
            add (sin (({_current} / 180) * 3.14159265358979323846)) * {_radius} to z-loc of {_l}
This? I just cannot understand it
[doublepost=1527815694,1527815659][/doublepost]Again Thank you very much for your help
 
it algorithm which calculating value which will be added to location of object.. so it its every time returns values likes "0.461654, 0.65645454, 0.955716, 1.85456548, 2.65451511, -1.562211, -0.564455424......" and.. you can remove line with y axis changing because 1. you dont need it, 2. skript cannot run it.. its for rotating not horizontally but vertically.. and i would use:
code_language.skript:
add ((sin ({_rotation} / 180) - cos ({_rotation} / 180)) * 3.14159265358979323846) * ((cos (({_current} / 180) * 3.14159265358979323846)) * {_radius}) to y-loc of {_l}
I dont know how did i made it but with these:
code_language.skript:
set {_radius} to 0.5
set {_angle} to 20
set {_rotation} to 180
parameters its works good
 
Status
Not open for further replies.