#how to make it so animals can interact with regions

1 messages · Page 2 of 1

royal cobalt
#

if its not in the list it doesnt get looped

grand citrus
#

.

royal cobalt
#

once it runs out of elements, what is left to loop?

#

its also quite inconsiderate to repeatedly bug others for basic questions

grand citrus
#

u still didn't answer my questions

grand citrus
royal cobalt
#

dont bother people and beg for answers

#

go do some detective work

grand citrus
#

FINE

#

I WILL DO DETECIVE WORK

#

it didn't work

#

yeah its completely broken

#

am going back to my normal loop

#

due to indentation

royal cobalt
#

are you really reloading all scripts each time

grand citrus
#

yes

#

ofc I am

royal cobalt
#

why? you only need to reload the one

grand citrus
#

cuz I don't want to type out the name of my skript

royal cobalt
#

tab completions exist

#

and you could just copy-paste it

#

or, minecraft has a built-in feature to pull up the last command again

grand citrus
#

I accidently deleted my code

#

and I don't have it saved

#

what do i do

royal cobalt
#

I kept warning you to be mindful ¯_(ツ)_/¯

#

if this has been such a reoccuring issue, and you havent learned or changed then its completely on you

grand citrus
#

nvm

grand citrus
#

wait

#

how I limit the bonus to 15???

#

for the

#

thing

#

send "&aYou earned!: +%floor({Steak} / 32 - 1)% bonus on steak!" to player

low oyster
#

set a temp variable (one that starts with _, hopefully you know that) to what is circled in red (no percent signs)
Then, check if that variable >= 15

grand citrus
#

what is a temp variable

low oyster
#

you gotta be freaking kidding me

grand citrus
#

oh is temp short for temporary???

low oyster
#

that is one of the most BASIC Skript things.

grand citrus
#

temp is one of the most basic skript things/??

low oyster
#

variables

grand citrus
#

ik how to do variables

low oyster
#

specifically, knowing the difference between a temp (temporary) and global variable

grand citrus
#

and why we need a var??

#

oh

#

nvm

#

ik

low oyster
#

you can use it directly if you want to, but I find variables easier

royal cobalt
#

or just use the minimum function

grand citrus
#

???

royal cobalt
#

it will return the minumum out of all the arguments

#

you know, this is all pretty self explanatory

grand citrus
#

huh

#
                                    if {_number} is >= 15:
                                        send "&aYou earned!: +15 bonus on steak!" to player
                                    else:
                                        send "&aYou earned!: +%{_number}% bonus on steak!" to player```
grand citrus
#

I need help

#

again

#
            if {Food} is 0:
                stop
            else:
                if event-player is {foodplayer}:
                    set {Food} to {Food} - 1
                    if {number} >= 15:
                        give player 19 cooked beef
                    else:
                        give player {number} + 4 cooked beef
                    set {Steak} to {Steak} - 100```
#

what I do

low oyster
#

where did you set {number}

grand citrus
#

same code

#

but without the _ and is

low oyster
#

{_number} != {number}

grand citrus
low oyster
#

clearly you still don't understand the difference between a global and local (temporary) variable

grand citrus
#

???

#
                                    if {number} >= 15:
                                        send "&aYou earned!: +15 bonus on steak!" to player
                                    else:
                                        send "&aYou earned!: +%{number}% bonus on steak!" to player``` ok here new code
low oyster
#

now it'll work, but {number} is global for everything, meaning if there are multiple players doing the thing you want them to do, they will all affect that variable

grand citrus
#

no

#

that was the same code

#

that used the error

grand citrus
covert pilot
#

Can you send your code with readable indentation first

royal cobalt
royal cobalt
royal cobalt
#

what we've been saying

#

and what is really apparently obvious, is

#

your code is indented (pushed to the right) far too much for it to be readable

royal cobalt
grand citrus
#

gtg

covert pilot
#

Use {_var} of cooked beef

#

This is a simple fix you’ve learned many times in the past but you still haven’t tried to actually put effort and try it

grand citrus
#

ok

winged owl
#

Counting and it at 1091 messages...

grand citrus
#

ok

royal cobalt
royal cobalt
grand citrus
#

yeah

#

oh

grand citrus
#

I need help

#
                make {farmplayer} see water as water``` I want to make the player see water not at 1 block but at the whole region
royal cobalt
#

you need to loop the blocks and do that individually then

grand citrus
#

bruh

#

I don't wanna do it indiviually

royal cobalt
#

Well, thats what youre gonna have to do

grand citrus
#

bruhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

#

there is is really no other way??

royal cobalt
#

You need to use that effect per block

grand citrus
#

ok

winged owl
#

can't you just do so that you loop all blocks in a region

#

Like

#
  if loop-block is water:
    make {farmplayer} see loop-block as water```
#

Done no?

grand citrus
#

I can try that

#

am pretty sure u use loop-value tho

winged owl
#

iit can't be either

#

Doesn't matter

#

It a bit better since it a bit more specific

grand citrus
#

ok

#
                                        if loop-block is air:
                                            make {farmplayer} see loop-block as water```
#

no errors

#

tahts a good sign

winged owl
#

well?

grand citrus
winged owl
#

sorry what

grand citrus
# grand citrus huh

oh, idk if the loop thing worked cuz I didn't see anything but this is a diff problem

winged owl
#

Uh.

#

Are you sure {farmplayer} is actually saved as you

grand citrus
#

yes

#
    if player's inventory contains paper named "Farm Task":
        if {farmtaskstarted} is false:
            set {farmtaskstarted} to true
            play sound "entity.experience_orb.pickup" with volume 1 to the player
            set {farmplayer} to event-player
            set {taskbar1} to true
            while {taskbar1} is true:
                send action bar "&aOpen the Middle Fence Gate" to player
                wait 1 second```
winged owl
#

And second, you sure that make %target% see %thing% as %thing% is actually a action that doesn't need addons or anything?

#

Please make the variables local variables

grand citrus
#

not a addon

winged owl
#

This is making me so annoyed

#

But

grand citrus
winged owl
#

Did you try it out with one single block if it worked?

grand citrus
#
    if {farmtaskstarted} is true:
        if event-entity is {farmplayer}:
            if distance between event-location and location(28.5, 0.5, 163.5, event-world) < 0.01:
                wait 5 ticks
                play sound "entity.experience_orb.pickup" with volume 1 to the player
                set {taskbar1} to false
                set block at location(28.5, 0.5, 163.5, event-world) to air #middle
                set block at location(27.5, 0.5, 163.5, event-world) to air
                set block at location(29.5, 0.5, 163.5, event-world) to air
                #winner side
                set block at location(28.5, 0.5, 172.5, event-world) to air
                set block at location(27.5, 0.5, 172.5, event-world) to air
                set block at location(29.5, 0.5, 172.5, event-world) to air
                set {fencegateopen} to true
                set {taskbar2} to true
                loop all blocks in the region "animal-player":
                    if loop-value is air:
                        make {farmplayer} see loop-value as water
                while {taskbar2} is true:
                    send action bar "&aGo in between the 2 sides on the left side to start animal parkour" to player
                    wait 1 second```
#
    add event-entity to {AnimalList::*}
on death of cow or chicken or pig:
    cancel drops
    if {farmtaskstarted} is true:
        if {fencegateopen} is true:
            if {farmtaskstep1} is true:
                if {KillCheck} is true:
                    remove victim from {AnimalKillList::*}
                    if size of {AnimalKillList::*} is 0:
                        set {taskbar3} to false
                        set {AnimalDead} to true```
#

this is why I need the vars to be not global

winged owl
#

Since that I'm over 110% sure isn't broken

grand citrus
#

ok

#

nope

#

nothing

grand citrus
royal cobalt
#

How do you think

grand citrus
#

idk

royal cobalt
#

You literally already had a line. For it

grand citrus
#

I tried using location() but it erroed

winged owl
#

Just use token command

grand citrus
#

what is token command??

winged owl
#

!make player see block at player's location as water

#

Just use that

#

You might need to activate it the settings

grand citrus
#

huh

winged owl
#
effect command token: !
# If 'enable effect commands' is set to true, chat messages starting with the 'effect command token' will be interpreted as effects and executed.
# The token can be longer than a single character, but it should not start with '/' as that starts a command.
# A player needs the permission "skript.effectcommands" to use such commands,
# which does not default to OPs since these commands can do severe damage to the world or crash the server (see below).
# Some example commands which can be used if this setting is enabled:
#    !heal player - heals the player (doesn't do anything if used from the console)
#    !repair tool - repairs the currently held item
#    !broadcast "<red>Please read the rules!" - if you want to get rid of the quotes you have to define a custom command
#    !set time to 6:00 - sets the time in the current world
# The command can also be abused, so only give the permission to trusted players, like owners & co-owners:
#    !set player's balance to 999999999 - when a compatible economy plugin is installed, this will give the command sender as much money as desired
#    !create explosion of force 10000 - likely crashes the server or at least hangs it up for a long time
#    !ban all players - as the effect implies

allow ops to use effect commands: true
# Whether server operators which do not have the permission "skript.effectcommands" should have access to effect commands.
# This setting is mainly useful for servers that do not run any permissions plugin.```
#

Here

#

Put allow ops to use effect commands and enable effect commands to true

#

It super useful

#

You can do a lot of stuff with it

#

Like

#

!spawn a zombie at player

#

!kill all zombies

#

!set player's max health to 1000

#

etc

covert pilot
#

Effect commands, they just let you do effects with ! in front of it

#

But there's no need to do it if you don't want

grand citrus
winged owl
#

Yes obvisouly

covert pilot
#

It's useful for debugging

winged owl
#

But skript allows you to do debugging, set variables, do some custom effects only skript can do, etc

grand citrus
#

ok

#

this works make {farmplayer} see block at {farmplayer} as water

#
    if {farmtaskstarted} is true:
        if event-entity is {farmplayer}:
            if distance between event-location and location(28.5, 0.5, 163.5, event-world) < 0.01:
                wait 5 ticks
                play sound "entity.experience_orb.pickup" with volume 1 to the player
                set {taskbar1} to false
                set block at location(28.5, 0.5, 163.5, event-world) to air #middle
                set block at location(27.5, 0.5, 163.5, event-world) to air
                set block at location(29.5, 0.5, 163.5, event-world) to air
                #winner side
                set block at location(28.5, 0.5, 172.5, event-world) to air
                set block at location(27.5, 0.5, 172.5, event-world) to air
                set block at location(29.5, 0.5, 172.5, event-world) to air
                set {fencegateopen} to true
                set {taskbar2} to true
                make {farmplayer} see block at {farmplayer} as water
                loop all blocks in the region "animal-player":
                    if loop-value is air:
                        make {farmplayer} see loop-value as water
                while {taskbar2} is true:
                    send action bar "&aGo in between the 2 sides on the left side to start animal parkour" to player
                    wait 1 second``` but loop doesn't
winged owl
grand citrus
#

ok

#

__________________________________________________________

/ / / /\ \

_____________________________________________________/ /

/ / _____ __ __ / /

/ / / ___\ / / // /\ / /

/ / / /__ / /___ ___ __ ______ _/ / / /

/ / ___ \ / __/ / _\ / / / __ // __/ / /

/ / ___/ / / /\ \ / / / / / // / / / / /

/ / _/ // // // // / _/ // / /

/ / ========================== / / ========== / / \ \

| | /_/ | | | |

___________________________________________________//

winged owl
#

...

#

That didn't work well huh

grand citrus
#

yeah

#

do I have to restart

#

after I put true

#

@winged owl ??

winged owl
#

nO

#

No*

#

/sk reload config

grand citrus
#

to late

#

I already did

#

soo

grand citrus
winged owl
#

Wdym it "doesn't work"

grand citrus
#

it doesn't do anything

#

why does no one get this

#

I will tell u if it errors

#

and send a ss

covert pilot
#

Try debugging it

#

then

grand citrus
#

ok

covert pilot
#

Check if the loop is happening

grand citrus
#

pokkkkkkkkkkkk

grand citrus
#

it def loops

#
                    broadcast "loopy"
                    if loop-value is air:
                        make {farmplayer} see loop-value as water```
covert pilot
#

broadcast the loop-value

grand citrus
#

ok

#

😡

#

the builder

#

does not need to put light blocks everywhere

#

it works now

grand citrus
#

guys

#

I figured out

#

why the farm task

#

sometimes doesn't work

covert pilot
#

👍

grand citrus
#

wait

#

ok I fixed it

#

but

#

we have a new problem

#
    cooldown: 5 second
    cooldown message: &cWait %remaining time% seconds
    permission: skript.pro
    permission message: &cYou do not have permission to use this!
    trigger:
        send "&eSteak Left: %{Steak}%" to player
        if {number} >= 15:
            send "&aYou have a +15 bonus on steak!" to player
        else:
            send "&aYou have a +%{number}% bonus on steak!" to player
        send "&4Raw Steak left: %{NoobFoodBeef}%" to player
        send "&cRaw Chicken left: %{NoobFoodChicken}%" to player```
#

set {number} to floor({Steak} / 32 - 1)

#

why is the bonus still +3 even if the steak is negactive

grand citrus
#

how do I fix this

#

how do I check

#

if it is negactice or not

covert pilot
#

what is a negative number?

grand citrus
#

like

#

-1

covert pilot
#

How would you define it.

#

Is what I'm asking.

grand citrus
#

oh

covert pilot
#

I know exactly what a negative number is

grand citrus
#

a number below 0

covert pilot
#

Mhm

#

How do you check if it's below 0?

grand citrus
#

oh

#

{number} < 0

covert pilot
#

mhm

grand citrus
#

ok

covert pilot
#

Also, I'd HIGHLY recommend local variables

grand citrus
#

but that wouldn't work with what am doing

grand citrus
#

wait

grand citrus