#how to make it so animals can interact with regions
1 messages · Page 2 of 1
.
once it runs out of elements, what is left to loop?
its also quite inconsiderate to repeatedly bug others for basic questions
u still didn't answer my questions
and what u talking about??
just
dont bother people and beg for answers
go do some detective work
FINE
I WILL DO DETECIVE WORK
it didn't work
yeah its completely broken
am going back to my normal loop
due to indentation
are you really reloading all scripts each time
why? you only need to reload the one
cuz I don't want to type out the name of my skript
tab completions exist
and you could just copy-paste it
or, minecraft has a built-in feature to pull up the last command again
thats why
I accidently deleted my code
and I don't have it saved
what do i do
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
nvm
wait
how I limit the bonus to 15???
for the
thing
send "&aYou earned!: +%floor({Steak} / 32 - 1)% bonus on steak!" to player
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
what is a temp variable
you gotta be freaking kidding me
oh is temp short for temporary???
that is one of the most BASIC Skript things.
temp is one of the most basic skript things/??
variables
ik how to do variables
specifically, knowing the difference between a temp (temporary) and global variable
you can use it directly if you want to, but I find variables easier
or just use the minimum function
???
it will return the minumum out of all the arguments
you know, this is all pretty self explanatory
huh
if {_number} is >= 15:
send "&aYou earned!: +15 bonus on steak!" to player
else:
send "&aYou earned!: +%{_number}% bonus on steak!" to player```
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
where did you set {number}
.
same code
but without the _ and is
{_number} != {number}
.
clearly you still don't understand the difference between a global and local (temporary) variable
???
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
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
this error was with that code
wdym
pls help
Can you send your code with readable indentation first
they've made i think 4 posts just for that, and its come up in others
^^^^
Just use conditions instead of if statements, or use an if all
????
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
or just indent with like 2 spaces instead of 2 tabs
gtg
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
ok
I don't remeber
Counting and it at 1091 messages...
ok
dw, i think their record is 2k+
thats the issue
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
you need to loop the blocks and do that individually then
Well, thats what youre gonna have to do
You need to use that effect per block
ok
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?
ok
if loop-block is air:
make {farmplayer} see loop-block as water```
no errors
tahts a good sign
well?
huh
sorry what
oh, idk if the loop thing worked cuz I didn't see anything but this is a diff problem
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```
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
not a addon
Did you try it out with one single block if it worked?
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
not yet
So check that first before this
Since that I'm over 110% sure isn't broken
how I try it with single block
How do you think
idk
You literally already had a line. For it
I tried using location() but it erroed
Just use token command
what is token command??
!make player see block at player's location as water
Just use that
You might need to activate it the settings
huh
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
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
you can do /kill @e[type=zombie]
Yes obvisouly
It's useful for debugging
But skript allows you to do debugging, set variables, do some custom effects only skript can do, etc
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
also where do I find that
ok
__________________________________________________________
/ / / /\ \
_____________________________________________________/ /
/ / _____ __ __ / /
/ / / ___\ / / // /\ / /
/ / / /__ / /___ ___ __ ______ _/ / / /
/ / ___ \ / __/ / _\ / / / __ // __/ / /
/ / ___/ / / /\ \ / / / / / // / / / / /
/ / _/ // // // // / _/ // / /
/ / ========================== / / ========== / / \ \
| | /_/ | | | |
___________________________________________________//
y doesn't loop work??
Wdym it "doesn't work"
it doesn't do anything
why does no one get this
I will tell u if it errors
and send a ss
ok
Check if the loop is happening
pokkkkkkkkkkkk
it def loops
broadcast "loopy"
if loop-value is air:
make {farmplayer} see loop-value as water```
broadcast the loop-value
👍
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
what is a negative number?
oh
I know exactly what a negative number is
a number below 0
mhm
ok
Also, I'd HIGHLY recommend local variables
but that wouldn't work with what am doing
wait
I found out how to fix this problem