You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had an idea that if we have a function: function example(p: player): send "Hellp, %{_p}%" to {_p}
And we then have to type out {_p} every time we want to get a player. An idea to make skript even more intuitive would be to be able to use "player" instead of {_p} if there is only one player parameter, and we can extend this outside player type, we have keywords like "entity" "block" "item" "number".
We could also add "arg-1" and "arg-2" too if we have multiple of them. We can also add item-1, item-2... to differentiate them. We could throw an error if the programmer uses "player" in for example function example2(p1: player, p2: player): We could extend this further and add another way to declare a parameter without a name function example3(player, player, item): They would be accessible only through this new syntax.
This would allow people to copy code from a player event(like a command or on inventory click) to a function without meticulously replacing every "player" to "{_p}"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I had an idea that if we have a function:
function example(p: player):
send "Hellp, %{_p}%" to {_p}
And we then have to type out {_p} every time we want to get a player. An idea to make skript even more intuitive would be to be able to use "player" instead of {_p} if there is only one player parameter, and we can extend this outside player type, we have keywords like "entity" "block" "item" "number".
We could also add "arg-1" and "arg-2" too if we have multiple of them. We can also add item-1, item-2... to differentiate them. We could throw an error if the programmer uses "player" in for example
function example2(p1: player, p2: player):
We could extend this further and add another way to declare a parameter without a namefunction example3(player, player, item):
They would be accessible only through this new syntax.This would allow people to copy code from a player event(like a command or on inventory click) to a function without meticulously replacing every "player" to "{_p}"
Beta Was this translation helpful? Give feedback.
All reactions