#Mob spawning
1 messages · Page 1 of 1 (latest)
There is a way
Make a function for spawning it
And just make a code where if that specific cow is killed, it runs the function
ok thanks
like this?
Wait 5 seconds
Spawn another cow with noAi NBT```
That’s not how functions work
Do some googling on how functions work for entity types :)
idk bro i am trying
wait 5 seconds
set {_n} to nbt compound from "{NoAI:1b}"
spawn cow at location(69, -60 -15 world "skripts") with nbt {_n}```
this?
idk how functions work 100%
Entity type instead of player
wait 5 seconds
set {_n} to nbt compound from "{NoAI:1b}"
spawn cow at location(69, -60 -15 world "skripts") with nbt {_n}```
also this error
Oh yeah I noticed that but forgot to tell you
👍 now?
i have multiple cow spawns tho
how would that work?
this doesnt work too
wait 5 seconds
set {_n} to nbt compound from "{NoAI:1b}"
spawn cow at location(69, -60, -15, world "skripts") with nbt {_n}```
i get no errors but it doesnt work
it spawns like 300 cows
and then they all die from entity cramming
and then 24 remain
they have the noAi nbt
but why does it spawn that many?
you might've looped all players or something
i dont think so
show full code
why loop all players every second
just make a function with boolean
and check upon killing mobs
that is not the point
so it can return value
it most likely is
Im trynna help you get your code as efficienct as possible
ok
im bad with functions
they are easy to learn
loop all players:
if {combat::%loop-player's uuid%} is 1:
if {combatxp::%loop-player's uuid%} >= 50:
set {combat::%loop-player's uuid%} to 2
set {combatxp::%loop-player's uuid%} to 0
send "&7-----------&8-----------" to loop-player
send "&e&lCOMBAT 1 → COMBAT 2" to loop-player
send "&7-----------&8-----------" to loop-player
if {combat::%loop-player's uuid%} is 2:
if {combatxp::%loop-player's uuid%} >= 150:
set {combat::%loop-player's uuid%} to 3
set {combatxp::%loop-player's uuid%} to 0
send "&7-----------&8-----------" to loop-player
send "&e&lCOMBAT 2 → COMBAT 3" to loop-player
send "&7-----------&8-----------" to loop-player
if {combat::%loop-player's uuid%} is 3:
if {combatxp::%loop-player's uuid%} >= 500:
set {combat::%loop-player's uuid%} to 4
set {combatxp::%loop-player's uuid%} to 0
send "&7-----------&8-----------" to loop-player
send "&e&lCOMBAT 3 → COMBAT 4" to loop-player
send "&7-----------&8-----------" to loop-player
if {combat::%loop-player's uuid%} is 2:
if {combatxp::%loop-player's uuid%} >= 1000:
set {combat::%loop-player's uuid%} to 3
set {combatxp::%loop-player's uuid%} to 0
send "&7-----------&8-----------" to loop-player
send "&e&lCOMBAT 4 → COMBAT 5" to loop-player
send "&7-----------&8-----------" to loop-player
stop```
this ?
thats a very bad code yeah
how do i do it?
lemme show you
function check(stuff here) :: boolean:
if {var} is x:
return true
else:
return false
on death of x:
if check(stuff here) = true
#do stuff
gotta fill out the x and whatever I didnt do since I can't spoonfeed
spoonfeed?
Spoonfeeding is when you spoil the whole code
If I were to give you the whole code
Its not allowed
if {combat::%loop-player's uuid%} is 1:
if {combatxp::%loop-player's uuid%} >= 50:
set {combat::%loop-player's uuid%} to 2
set {combatxp::%loop-player's uuid%} to 0
send "&7-----------&8-----------" to loop-player
send "&e&lCOMBAT 1 → COMBAT 2" to loop-player
send "&7-----------&8-----------" to loop-player
if {combat::%loop-player's uuid%} is 2:
if {combatxp::%loop-player's uuid%} >= 150:
set {combat::%loop-player's uuid%} to 3
set {combatxp::%loop-player's uuid%} to 0
send "&7-----------&8-----------" to loop-player
send "&e&lCOMBAT 2 → COMBAT 3" to loop-player
send "&7-----------&8-----------" to loop-player
if {combat::%loop-player's uuid%} is 3:
if {combatxp::%loop-player's uuid%} >= 500:
set {combat::%loop-player's uuid%} to 4
set {combatxp::%loop-player's uuid%} to 0
send "&7-----------&8-----------" to loop-player
send "&e&lCOMBAT 3 → COMBAT 4" to loop-player
send "&7-----------&8-----------" to loop-player
if {combat::%loop-player's uuid%} is 2:
if {combatxp::%loop-player's uuid%} >= 1000:
set {combat::%loop-player's uuid%} to 3
set {combatxp::%loop-player's uuid%} to 0
send "&7-----------&8-----------" to loop-player
send "&e&lCOMBAT 4 → COMBAT 5" to loop-player
send "&7-----------&8-----------" to loop-player
stop```
like that?
wait mb
also return true/false
true is if its meeting the correct requirements
false is the opposite
I usually use it for checking if player has met correct requirements
now run the function on death event
(this makes it so if a player kills a mob it checks their variable and levels up their combat)
so you dont need to do it every second
like this?
if {combat::%player's uuid%} is 1:
if {combatxp::%player's uuid%} >= 50:
set {combat::%player's uuid%} to 2
set {combatxp::%player's uuid%} to 0
send "&7-----------&8-----------" to {_p}
send "&e&lCOMBAT 1 → COMBAT 2" to {_p}
send "&7-----------&8-----------" to {_p}
if {combat::%player's uuid%} is 2:
if {combatxp::%player's uuid%} >= 150:
set {combat::%player's uuid%} to 3
set {combatxp::%player's uuid%} to 0
send "&7-----------&8-----------" to {_p}
send "&e&lCOMBAT 2 → COMBAT 3" to {_p}
send "&7-----------&8-----------" to {_p}
if {combat::%player's uuid%} is 3:
if {combatxp::%player's uuid%} >= 500:
set {combat::%player's uuid%} to 4
set {combatxp::%player's uuid%} to 0
send "&7-----------&8-----------" to {_p}
send "&e&lCOMBAT 3 → COMBAT 4" to {_p}
send "&7-----------&8-----------" to {_p}
if {combat::%player's uuid%} is 4:
if {combatxp::%player's uuid%} >= 1000:
set {combat::%player's uuid%} to 5
set {combatxp::%player's uuid%} to 0
send "&7-----------&8-----------" to {_p}
send "&e&lCOMBAT 4 → COMBAT 5" to {_p}
send "&7-----------&8-----------" to {_p}
stop```
it works tbh
i have this too
loop all players:
if {combat::%loop-player's uuid%} is 1:
send action bar "&e%{combatxp::%loop-player's uuid%}%/50xp" to loop-player
if {combat::%loop-player's uuid%} is 2:
send action bar "&e%{combatxp::%loop-player's uuid%}%/150xp" to loop-player
if {combat::%loop-player's uuid%} is 3:
send action bar "&e%{combatxp::%loop-player's uuid%}%/500xp" to loop-player
if {combat::%loop-player's uuid%} is 4:
send action bar "&e%{combatxp::%loop-player's uuid%}%/1000xp" to loop-player
stop```
should ii make it like this?
if {combat::%player's uuid%} is 1:
send action bar "&e%{combatxp::%loop-player's uuid%}%/50xp" to {_p}
if {combat::%player's uuid%} is 2:
send action bar "&e%{combatxp::%loop-player's uuid%}%/150xp" to {_p}
if {combat::%player's uuid%} is 3:
send action bar "&e%{combatxp::%loop-player's uuid%}%/500xp" to {_p}
if {combat::%player's uuid%} is 4:
send action bar "&e%{combatxp::%loop-player's uuid%}%/1000xp" to {_p}
stop```
{_p}
dont do stop
ok
if {combat::%{_p}'s uuid%} is 4:
like that?
ok fixed it
bruh the cow bug still remains
this?
wait 5 seconds
set {_n} to nbt compound from "{NoAI:1b}"
spawn cow at location(69, -60, -15, world "skripts") with nbt {_n}```
but i want it to spawn 5 seconds after the other one died
skript doesnt fit in discord
how
just send it
you still have every 1 seconds
yea
remove it
how will the player see their xp ):
ok done
now it should work
it doesnt lmao
i removed the death and it works
set {_n} to nbt compound from "{NoAI:1b}"
spawn 1 cow with nbt {_n}```
U removed this right?
but it spawns with an Ai
yea
spawn 1 cow?
yes it spawns one cow but it spawns with a Ai
theres no location
there is
wait 5 seconds
set {_n} to nbt compound from "{NoAI:1b}"
spawn cow at location(69, -60, -15, world "skripts") with nbt {_n}```
can i get skript-debug for that?
its fixing the error
clowns on you
waaaa
Soo then ur skript is fine
but it doesnt work
That’s why u debug it
the cow doesnt get the noAi nbt
i have the function but it doesnt work
idk how to run the function when a cow spawns
why did you leave me on read? ):
@sick glen sorry for pinging you but can i use this instead of the function?
if event-entity is cow:
if location of event-entity is 69, -60, -15, in world "skripts":
wait 5 seconds
spawn 1 cow with nbt "{NoAI:1b}" at location 69, -60, -15, in world "skripts"```
Try
should i do
if victim is cow:
if location of victim is 69, -60, -15, in world "skripts":
wait 5 seconds
spawn 1 cow with nbt "{NoAI:1b}" at location 69, -60, -15, in world "skripts"```
Use the location function
it is resolved
i used this in the end
if victim is cow:
if attacker is player:
if location of victim is location(-69, -60, -24, world "skripts", 90, 0):
wait 2.5 seconds
set {_n} to nbt compound from "{NoAI:1b}"
spawn cow at location(-69, -60, -24, world "skripts", 90, 0) with nbt {_n}```
i didnt i just replied
oh mb
if feel like that won't work because the player is unlikely not at a very specific block, he's gonna be in a region
you could check for worldguard regions or check between 2 locations
it works perfectly so no
oh cus its the cow's location, makes sense
Huh?
Thats a very bad idea
my idea is the only way to do it if you check the player location, I didnt know he was checking the cow's location
no need to check between locations