Solved make npc visible only for 1 player

  • 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 need help with this script:
Code:
function circleBot(p: player):
    set {_name} to "&c%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 1, 100, 0
    make console execute command "npc select %{_name}%"
    make console execute command "npc gravity"
    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 4 times:
        loop 360 times:
            set {_ploc} to location of {_p}
            set {_v} to cylindrical vector 2, loop-number-2, 1
            teleport {_e} to {_ploc} ~ {_v}
            mod(loop-number-2, 16) = 0
            wait 1 ticks
    remove {_e} from {bots::*}
    remove npc {_n}
    delete npc {_n}
    delete {botcheck::%{_p}%}
 
on damage:
    if {bots::*} contains victim:
        if 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)

So i need to make npc visible only for 1 player (prob violator)

Here a video of bot-checks:
(First circle check is in another skript)

And there is 1 more problemm. - I cant use those scripts with SkQuery... Idk why, but when I adding a SkQuery plugin to my server the skripts going down with this error:
Code:
[13:45:01 ERROR]: #!#! [Skript] Severe Error:
[13:45:01 ERROR]: #!#! Could not load bot.sk
[13:45:01 ERROR]: #!#!
[13:45:01 ERROR]: #!#! Something went horribly wrong with Skript.
[13:45:01 ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[13:45:01 ERROR]: #!#! Your Minecraft version or server software appears to be unsupported by Skript (bensku's version).
[13:45:01 ERROR]: #!#! Currently only supported servers are Spigot and its forks for Minecraft 1.9 or newer.
[13:45:01 ERROR]: #!#! Other versions might work, but since you're getting this error message something is NOT working,
[13:45:01 ERROR]: #!#! nor it will work, unless you switch to supported platform.
[13:45:01 ERROR]: #!#! Issue tracker: https://github.com/SkriptLang/Skript/issues (only if you know what you're doing!)
[13:45:01 ERROR]: #!#!
[13:45:01 ERROR]: #!#! Stack trace:
[13:45:01 ERROR]: #!#! ch.njol.skript.SkriptAPIException: No class info found for lambda
[13:45:01 ERROR]: #!#!     at ch.njol.skript.registrations.Classes.getClassInfo(Classes.java:263)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.createExprInfo(SkriptParser.java:1804)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.getExprInfo(SkriptParser.java:1771)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1519)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:225)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:180)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parseSingleExpr(SkriptParser.java:495)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parseExpression(SkriptParser.java:814)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1535)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1492)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1531)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1492)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1492)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1465)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:225)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:180)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parseSingleExpr(SkriptParser.java:325)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parseExpression(SkriptParser.java:627)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.VariableString.newInstance(VariableString.java:241)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.VariableString.newInstance(VariableString.java:145)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parseSingleExpr(SkriptParser.java:493)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parseExpression(SkriptParser.java:814)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1535)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1531)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:225)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:180)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.Statement.parse(Statement.java:59)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:972)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.function.ScriptFunction.<init>(ScriptFunction.java:50)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.lang.function.Functions.loadFunction(Functions.java:143)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:634)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.ScriptLoader.lambda$1(ScriptLoader.java:389)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:401)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.ScriptLoader.lambda$0(ScriptLoader.java:331)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:361)
[13:45:01 ERROR]: #!#!     at ch.njol.skript.Skript$2.run(Skript.java:490)
[13:45:01 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
[13:45:01 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
[13:45:01 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723)
[13:45:01 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
[13:45:01 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[13:45:01 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[13:45:01 ERROR]: #!#!     at java.lang.Thread.run(Unknown Source)
[13:45:01 ERROR]: #!#!
[13:45:01 ERROR]: #!#! Version Information:
[13:45:01 ERROR]: #!#!   Skript: 2.2-dev36
[13:45:01 ERROR]: #!#!   Bukkit: 1.8.8-R0.1-SNAPSHOT
[13:45:01 ERROR]: #!#!   Minecraft: 1.8.8
[13:45:01 ERROR]: #!#!   Java: 1.8.0_201 (Java HotSpot(TM) 64-Bit Server VM 25.201-b09)
[13:45:01 ERROR]: #!#!   OS: Windows 10 amd64 10.0
[13:45:01 ERROR]: #!#!
[13:45:01 ERROR]: #!#! Server platform: Spigot
[13:45:01 ERROR]: #!#!
[13:45:01 ERROR]: #!#! Current node: set {_name} to "&c%random integer between 11111111 and 99999999%" (bot.sk, line 2)
[13:45:01 ERROR]: #!#! Current item: null
[13:45:01 ERROR]: #!#!
[13:45:01 ERROR]: #!#! Thread: Server thread
[13:45:01 ERROR]: #!#!
[13:45:01 ERROR]: #!#! Language: english
[13:45:01 ERROR]: #!#! Link parse mode: DISABLED
[13:45:01 ERROR]: #!#!
[13:45:01 ERROR]: #!#! End of Error.
[13:45:01 ERROR]: #!#!
[13:45:01 ERROR]: #!#!

Help me pls :'(
 
OMG thanks a lot! Now SkQuery is working! But what I should do to hide bot from all players expect violator?
[doublepost=1564606347,1564502133][/doublepost]Up
set {_p} to (the player)
hide {_n} from all players
reveal {_n} to {_p}



Or maybe it is like this:
set {_p} to (the player)
hide npc {_n} from all players
reveal npc {_n} to {_p}
 
Status
Not open for further replies.