#Command doesent work
1 messages · Page 1 of 1 (latest)
i have this in the giveItem function
if {_return}:
return {_item}
else:
give {_amt} of {_item} to {_p}
but the getHead function doesn't return anything
and how do do it can you show me
return ...
like this
function getHead(item: text, return: boolean):: object:
if {_item} is "yetihead":
set {_item} to player head named "&r" with nbt from "{SkullOwner:{Id:[I;-123817,4104,121127,-8208],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOThjNjk5ZTNhOGI0MGM2MWQ0YTM1OTA0MDRhZTliYTUyNjJhYjRhMzVkODQyZjI3MWFmNDEzZDdmNGQyMGY1YSJ9fX0=""}]}}}"
if {_return}:
return {_item}
why if {_return}?
don't you always want to return it?
otherwise the function is useless
so insted of if {_return} i will only do return {_item}?
you can just return the item instead of setting it to a variable and then returning it
okay
so like this
function getHead(item: text):: object:
if {_item} is "yetihead":
set {_item} to player head named "&r" with nbt from "{SkullOwner:{Id:[I;-123817,4104,121127,-8208],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOThjNjk5ZTNhOGI0MGM2MWQ0YTM1OTA0MDRhZTliYTUyNjJhYjRhMzVkODQyZjI3MWFmNDEzZDdmNGQyMGY1YSJ9fX0=""}]}}}"
return {_item}
okay
Line 850: (functions/itemfunction.sk)
[11:47:50 INFO]: The return effect can only be used in functions, custom expressions, sections, custom syntax parse sections and custom conditions
[11:47:50 INFO]: Line: return
code?
function getHead(item: text):: object:
if {_item} is "yetihead":
set {_item} to player head named "&r" with nbt from "{SkullOwner:{Id:[I;-123817,4104,121127,-8208],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOThjNjk5ZTNhOGI0MGM2MWQ0YTM1OTA0MDRhZTliYTUyNjJhYjRhMzVkODQyZjI3MWFmNDEzZDdmNGQyMGY1YSJ9fX0=""}]}}}"
return
codeblocks
function getHead(item: text):: object:
if {_item} is "yetihead":
set {_item} to player head named "&r" with nbt from "{SkullOwner:{Id:[I;-123817,4104,121127,-8208],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOThjNjk5ZTNhOGI0MGM2MWQ0YTM1OTA0MDRhZTliYTUyNjJhYjRhMzVkODQyZjI3MWFmNDEzZDdmNGQyMGY1YSJ9fX0=""}]}}}"
return
what?
you're still setting the item to a variable
```code```
like this
where i deleted the {_item} in return
check the 3rd line
nahhhh i check it now with return {_item} and now i am getting it
why are you still using the {_item} variable?
bro its working now
I just told you you're doing something pointless
then what should i use insted of {_item}
wrong way: set {_item} to stone named "..." return {_item}
correct way: return stone named "..."
did you get it?
ye thanks