SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.06k stars 368 forks source link

Condition enhancements #6809

Closed MissingReports closed 3 months ago

MissingReports commented 3 months ago

Suggestion

First, I feel like making conditions act like expressions would be nice, for example set {_isSet} to {variable} is set This is most useful is functions where you would want to do something like this

function hasDiamond(p: player) :: boolean:
    return {_p} has diamond

instead of

function hasDiamond(p: player) :: boolean:
    if {_p} has diamond:
        return true
    return false

i know this is abit lazy but it also cleans the code abit. and doesn't cause confusion for people that use skript and java

Second, i don't even know why this isn't a thing but you can't do if true, you have to do if true is true which also causes confusion when using skript and java

Why?

Cleaning up code and makes skript similar to pretty much all scripting languages

Other

No response

Agreement

sovdeeth commented 3 months ago

See #6748