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!
You can always check out skUnity Downloads for downloads and any other information about Skript!
%entity's world%
%player's world%
world of %entity%
set {_var} to %thing's world%
if {_var} contains "worldname":
if world name is "pvp_smugglerspath" or "pvp_hollow" or "pvp_ice" or "pvp_dust" or "pvp_whitevalley" or "pvp_arena1":
on step on slime block:
wait 1 tick
do something
on step on slime block:
if
on step on slime block:
wait 1 tick
push player forwards with force 2
wait 1 tick
push player upwards with force 1
Ah! Now I see! So you could probably use something like this!
code_language.skript:on step on slime block: set {_var} to event-player's world if {_var} contains "pvp_": wait a tick push player forwards with force 2 wait a tick push player upwards with force 1
on step on slime block:
set {_var} to event-player's world
send "%{_var}%"
if {_var} contains "pvp_":
send "pvp"
wait 1 tick
push player forwards with force 2
wait 1 tick
push player upwards with force 1
play "ITEM_FIRECHARGE_USE" to player at volume 0.5
#show 10 "slime" particles at location of player for player offset by 0, 0, 1
set {launched::%player%} to true
else:
send "not pvp"
That means that the name of the world is infact pvp_whitevalley, so change
Does not work, I made this debug and I get:
pvp_whitevalley
not pvp
code_language.skript:on step on slime block: set {_var} to event-player's world send "%{_var}%" if {_var} contains "pvp_": send "pvp" wait 1 tick push player forwards with force 2 wait 1 tick push player upwards with force 1 play "ITEM_FIRECHARGE_USE" to player at volume 0.5 #show 10 "slime" particles at location of player for player offset by 0, 0, 1 set {launched::%player%} to true else: send "not pvp"
contains "pvp_"
contains "pvp_whitevalley"
if {_var} starts with "pvp_"
It would be easier to use:Well, you could use my addon? It's called Vixio here: https://forums.skunity.com/resources/vixio-1-0-8-the-best-discord-addon-on-the-market.19/ It's a Discord addon but it has `starts with` in it! So then you could use:
SkUtilities may also have it?Code:if {_var} starts with "pvp_"
on step on slime block:
set {_contains} to subtext of "%player's world%" from 1 to 4
if {_contains} is "pvp_":
# do stuff
on step on slime block:
if subtext of "%player's world%" from 1 to 4 is "pvp_":
# do stuff
on step on slime block:
if "%subtext of ""%player's world%"" from 1 to 4%" is "pvp_":
# do stuff
Hey! I didn't even know that was possible ;O. You really do learn something new everyday!It would be easier to use:
code_language.skript:on step on slime block: set {_contains} to subtext of "%player's world%" from 1 to 4 if {_contains} is "pvp_": # do stuff
...Or you could shorten that to:
code_language.skript:on step on slime block: if subtext of "%player's world%" from 1 to 4 is "pvp_": # do stuff on step on slime block: if "%subtext of ""%player's world%"" from 1 to 4%" is "pvp_": # do stuff
I might have messed up on the second example of the second code snippet, as I wasn't sure if two percent signs are required inside of an expression.
on step on slime block:
if subtext of "%player's world%" from 1 to 4 is "pvp_":
#only launchs players in worlds which name starts with "pvp_"
wait 1 tick
push player forwards with force 2
wait 1 tick
push player upwards with force 1
play "ITEM_FIRECHARGE_USE" to player at volume 1
#show 10 "slime" particles at location of player for player offset by 0, 0, 1
set {launched::%player%} to true
on damage:
if damage cause is fall:
if {launched::%victim%} is true:
cancel event
set {launched::%victim%} to false
on join:
set {launched::%player%} to false
on death:
set {launched::%player%} to false
on load:
delete {launched::*}