Spawning NPC

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

Wolwer

Active Member
Feb 8, 2018
53
5
8
Hello! I have a question: why an I getting those errors:
Code:
[23:06:31] [Server thread/ERROR]: Can't understand this condition/effect: spawn npc {_n} at location of {_p} ~ vector 2, 100, 0 (bot.sk, line 6: spawn npc {_n} at location of {_p} ~ vector 2, 100, 0')
[23:06:31] [Server thread/ERROR]: Can't understand this condition/effect: set gravity of {_e} to false (bot.sk, line 8: set gravity of {_e} to false')
[23:06:31] [Server thread/ERROR]: Can't understand this condition/effect: apply invisibility without particles to {_e} for 4 seconds (bot.sk, line 9: apply invisibility without particles to {_e} for 4 seconds')
[23:06:31] [Server thread/ERROR]: 'number-<...>' can only accept a single number, not more (bot.sk, line 15: set {_v} to cylindrical vector 3, loop-number-2, 1')
[23:06:31] [Server thread/ERROR]: Can't understand this condition/effect: teleport {_e} to {_ploc} ~ {_v} (bot.sk, line 16: teleport {_e} to {_ploc} ~ {_v}')
[23:06:31] [Server thread/ERROR]: '::%attacker%}' is not a valid item data (bot.sk, line 29: if {botcheck::%attacker%} = 4')

Skript: [SKRIPT CREATED by him https://forums.skunity.com/members/tpgamesnl.5917/ ]

Code:
function circleBot(p: player):
    set {_name} to "%random integer between 11111111 and 99999999%"
    set {_n} to npc named {_name} "PLAYER"
    set fly of npc {_n} to true
    set protect of npc {_n} to false
    spawn npc {_n} at location of {_p} ~ vector 2, 100, 0
    set {_e} to entity from npc {_n}
    set gravity of {_e} to false
    apply invisibility without particles to {_e} for 4 seconds
    wait 4 seconds
    add {_e} to {bots::*}
    loop 5 times:
        loop 360 times:
            set {_ploc} to location of {_p}
            set {_v} to cylindrical vector 3, loop-number-2, 1
            teleport {_e} to {_ploc} ~ {_v}
            mod(loop-number-2, 23) = 0
            wait 1 ticks
    remove {_e} from {bots::*}
    remove npc {_n}
    delete npc {_n}
    delete {botcheck::%{_p}%}
 
on damage:
    {bots::*} contains victim
    attacker is a player
    cancel event
    add 1 to {botcheck::%attacker%}
    if {botcheck::%attacker%} = 4
    kick attacker due to "Killaura suspect!"
 
command /bot:
    trigger:
        circleBot(player)

Skript version 2.2-Fixes-V8b
Skellett version 1.9.6b
skRayFall version 1.9.15
Citizens version 2.0.16-SNAPSHOT (build 1267)

P.s. Sorry for bad English
 
https://forums.skunity.com/resources/skript-npc.444/

https://docs.skunity.com/syntax/search/addon:skript-npc

Code:
create [a] (citizen|npc) [(named|with name)] %string% [and] [with] [entity] type %entitytype% [at %-location%]

create npc named "Nano" with type player at player's location

edit:
just noticed, you don't seem to be familiar with skript so yeah i'll be very soft & kind :emoji_slight_smile:

Code:
if {botcheck::%attacker%} = 4
kick attacker due to "Killaura suspect!"

to start off, you need to put ":" after the number 4 and you need a tab before "kick", then that is just non-sense kicking a player because of 4 hits with the reason kill aura?? what?? correct me if i'm wrong but that's not the right way of doing it... also kill aura is more like a 360º auto-aimbot not an auto clicker

edit 2:
i think i got your idea, but still it's not properly done (i think i got it)
Thanks! I will test it tomorrow.
 
Status
Not open for further replies.