Star Wars Skript

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Apr 21, 2021
3
0
1
37
I was bored and wondering if there was a way that I could make a skript that would be kinda like Star Wars with the Force and swords as "lightsabers" or something. I'm not looking for a mod or a resource pack, I'm just looking to see if I can make a plugin to make the game act that way.

I'm using Minehut for the server so I'm gonna have to constrict the addons to what's on there. Of course, the actual skript plugin is on there as well. The others on there are:
SkBee,
skript-logs,
skRayFall,
TuSKe,
MorkazSk,
Skript-JSON,
skript-db,
SkUniversal,
Vixio,
skript-placeholders,
skQuery,
Skematic,
Facsk,
skLib,
Skellett,
skDragon,
Misk,
Tablisknu,
GameAPI,
Sk-Perm,
skript-holo,
WolvSK,
SkVault,
FunkySk,
skript-gui,
Biosphere2,
MongoSK,
MongoSK 2,
SkJade,
skNoise,
Skacket

I know that some of these won't work for what I'm asking but I'm partly wondering if it's possible and partly asking if someone can help make it with me but I'm a bit new to skript so I'm still learning.

Thanks!
 
So you want lightsabers?

Code:
on right click with stick:
  push targeted entity forward of player at force 3
  message "&aUsed the &bFORCE"
 
I like the concept!
Code:
on leftclick:
    set {_v} to vector from player to targeted entity
    add 2 to y of {_v}
    push targeted entity {_v} at speed 2
    play sound "entity.wither.shoot" with volume 2 and pitch 0.7 at player for all players
Try left-clicking while pointing at a pig from afar.
 
I like the concept!
Code:
on leftclick:
    set {_v} to vector from player to targeted entity
    add 2 to y of {_v}
    push targeted entity {_v} at speed 2
    play sound "entity.wither.shoot" with volume 2 and pitch 0.7 at player for all players
Try left-clicking while pointing at a pig from afar.

This is great! A nice force push. Although, from a different skript I made, I can make a way to toggle this ability. Thanks!

If anyone is wondering how I did this, first, you need bPermissions in order for this to work. Basically, you make the console do the commands to add a certain permission. If you do /force, you can toggle using the force push that PatoFrango made. If you are op, you will always have the Force as you have all permissions. The code (idk how to do code box in this forum):

command /force:
permission: skript.forcetoggle
trigger:
if {force.%player%} is not set:
make console execute command "/user %player%"
make console execute command "/user addperm skript.force"
set {force.%player%} to true
send "&7You now have the Force."
else if {force.%player%} is true:
make console execute command "/user %player%"
make console execute command "/user rmperm skript.force"
delete {force.%player%}
send "&7May the Force be with you."

on leftclick:
if player has permission "skript.force":
set {_v} to vector from player to targeted entity
add 2 to y of {_v}
push targeted entity {_v} at speed 2
play sound "entity.wither.shoot" with volume 2 and pitch 0.7 at player for all players
 
Last edited:
Sounds about right! One thing I’d like to advise is to avoid using console commands. Skript has a solution for this in the docs, so always look there first:
https://skriptlang.github.io/Skript/expressions.html#ExprPermissions

Also, to do a code box, click on the plus symbol in the editor and click on “Code”
That's funny, because the description says:
"Note that the modifications to resulting list do not actually change permissions."
Using console commands would be the best way to add perms in this situation, but not the best in this situation in general.
Code:
command /force [<text>]:
    permission: skript.forcetoggle
    trigger:
        if {force::%player%} is not set:
            set {force::%player%} to true
            send "&7You now have the Force."
        else:
            delete {force::%player%}
            send "&7May the Force be with you."

on leftclick:
    if {force::%player%} is set:
        set {_v} to (normalized (vector from player to targeted entity)) ++ vector(0, 2, 0)
        push targeted entity {_v} at speed 2
        play sound "entity.wither.shoot" with volume 2 and pitch 0.7 at player for all players
This would be the best version of it.
It would actually be beneficial if they used metadata instead of variables due to it not being persistent, but it's not really necessary.
 
That's funny, because the description says:
"Note that the modifications to resulting list do not actually change permissions."
Using console commands would be the best way to add perms in this situation, but not the best in this situation in general.
Code:
command /force [<text>]:
    permission: skript.forcetoggle
    trigger:
        if {force::%player%} is not set:
            set {force::%player%} to true
            send "&7You now have the Force."
        else:
            delete {force::%player%}
            send "&7May the Force be with you."

on leftclick:
    if {force::%player%} is set:
        set {_v} to (normalized (vector from player to targeted entity)) ++ vector(0, 2, 0)
        push targeted entity {_v} at speed 2
        play sound "entity.wither.shoot" with volume 2 and pitch 0.7 at player for all players
This would be the best version of it.
It would actually be beneficial if they used metadata instead of variables due to it not being persistent, but it's not really necessary.
How does it not change permissions? If I add any permission with Skript and then check it through the permission’s plugin command on my server, it says I have the permission.
 
Status
Not open for further replies.