#Npc dialogue

1 messages · Page 1 of 1 (latest)

gleaming eagle
#

I wanna make a dialogue, but don't know how to make npcs reply player's answer.
I'm trying to do it with clickable text but i don't know how to add arguments to a command that runs when text clicked.
Or a command that only runs when text clicked. (Can't execute from chat)
Is there a way to execute a console command when text clicked?

analog star
#

You can make the command permission for ops or console only, then for clickable text: https://skripthub.net/docs/?id=9368

#

When you use create callback for [insert text component here]: the code under that will run when the text component is clicked

#

Make sure to set the text component first, of course

#

Then you send the text component to player

gleaming eagle
#

One thing i still don't know that how can i set the make text components

#

or is it just a normal text varible

analog star
gleaming eagle
#

it needs skbee no?

gleaming eagle
#

it shows as red

wanton goblet
#

It doesnt support ur server version

#

Which version u have

gleaming eagle
#

1.17.2

#

can i make it support my version?

wanton goblet
wanton goblet
gleaming eagle
#

(:

gleaming eagle
#

@analog star how can i call an argument in a callback?

analog star
#

If the normal arg-1 arg-2 etc isn't working you could try setting a var to that arg then using the var in the callback

gleaming eagle
#

i'll try

#

it dont say error but dont send me the msg

#

*doesnt

analog star
#

Send code

gleaming eagle
#
set {npc1-p} to arg-2 # arg-2 is the player
set {npc1-msg} to text component of "&fa, <tooltip:&aYes i did.><command:/npc1-1>&aYes i did. &7[Click here]<r>"
create callback with 1 use for {npc1-msg}:
    send "working!" to {npc-p}
send component {npc1-msg} to arg-2 # that doew not send the msg```
#

yeah and i installed skbee so that cant be the problem

analog star
#

And idk why u r using global vars

analog star
gleaming eagle
analog star
#

I think you can use local variables but ok

#

Does it work now

gleaming eagle
#

Idk I cannot test it now

#

But I will

analog star
#

The type of arg 2 is player right?

#

And not a string or something

gleaming eagle
#

yes

#

its a player

#
command /test:
    permission: op
    trigger:
        set {test} to text component of "test"
        create callback for {test} with 1 use:
            send "asd" to player
        send component {test} to player```
#

i made a more understandable version and its still not working

#

when i use that command it says:

analog star
#

Strange

#

You updated your server version to be compatible with skbee?

gleaming eagle
#

To 1.18.2

gleaming eagle
#

skript version: 2.6.3

analog star
#

Not really sure what to say then

gleaming eagle
#

i could search for text components and now i know what i them but i couldn't searc for callbacks they are in skript plugin or what

#

maybe my skript plugin is too old

gleaming eagle
# gleaming eagle

I tested and text components are working but if i try with callback it will show that error

fierce pasture
#

check /pl for red plugins

gleaming eagle
fierce pasture
#

make sure all your plugins are up to date and you dont have plugins like 'tuske'

#

or sk dragon sk query etc

#

reason: out of date

gleaming eagle
#

i have only skript and skbee of the plugins that are linked with skript

#

so... idk whats the problem

polar snow
#
  if citizen is <id>:
    send "message" to player```
#

if you have citizens that is

gleaming eagle
#

bro

#

i want the massage to be clickable

gleaming eagle
#

on an other way

polar snow
#

Or do you not mean a link?

gleaming eagle
#

no

polar snow
#

Ahh ok

gleaming eagle
#

minecraft format code is not good for me caouse i do not know how to add arguments to a command in it

#

is there a way to do it? @polar snow

polar snow
#

You'll have to do what they're telling you to to have a command I believe

#

for the format code you can only do links

gleaming eagle
#

no like
send "<command:/kill>Click Here To Kill Yourself<reset>" to player <-- its working
but its not -- > send "<command:/kill @e> Click Here To Kill Everyone<reset>" to player

#

i cant add args to it

polar snow
#

Ohh hm

#

If you dont wanna bother wasting time anymore you could make a command in Skript that literally just makes the player execute /kill @e lol

gleaming eagle
#

idiot

#

thats just an example

#

i just want a text when it gets clicked u execute a command with arguments

polar snow
#

Yeah you could do that with another command

#

Unless the argument needs to be specific to the player

gleaming eagle
#

now u dont know

polar snow
#

You could do something like this
command /name:
Trigger:
Make player execute command "/command %executor%"

gleaming eagle
#

that's good but players can use it without clicking on npcs

polar snow
#

Hm yeah ig

#

If it's a command console can execute somehow you could do that

#

Idk if there are any conditions that have to do with if they click on text only it'll allow them to use it

gleaming eagle
#

yeah

gleaming eagle
#

@everyone i did it

#

!!!!

#
    permission: op
    trigger:
        set {test} to a text component of "&fClick Here!"
        set hover event of {test} to hover event showing "Click Here!"
        set click event of {test} to click event to run command "/execute run kill @p"
        send component {test} to player```
lilac onyx
#

idc

gleaming eagle
#

ok

#

didnt ask

lilac onyx
sharp zealot
#

Bro really tried pinging everyone

gleaming eagle
#

no

gleaming eagle
sharp zealot
#

Nope

#

It pinged nobody at all...

junior sedge
#

Why did I get pinged

sharp zealot
#

wait

#

did it ping all people?

junior sedge
#

Im kidding

#

Lol

sharp zealot
#

k

#

good

junior sedge
#

I just randomly opened this and saw the conversation

sharp zealot
#

yup

#

Nah but why would you ping everybody

#

some people hate being pinged (me included)

junior sedge
#

Fr

#

Anyways Imma go

gleaming eagle
#

cuz i did it

sharp zealot
#

Yes but we don't want to be pinged