Skript Version: Skript (Latest Version)
Skript Author: SamDFL
Minecraft Version: 1.8.9
I've been trying to find a fix for this for ages, but I can't find it. Basically, I'm trying to teleport a player to a random location when they type /sw-join <arena>, which has been defined in a yaml file (see below for code). But it simply doesn't work for some reason, nothing happens. Any help would be much appreciated! Oh and also, I'm using WildSkript for yaml and not SkUtilites, I wont be switching, so please don't tell me to go to SkUtilites unless necessary.
---
Yaml Code:
Full Code:
Errors on Reload: None
Console Errors: None
Addons using (including versions):
Umbaska 2.0, WildSkript
Troubleshooting:
Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? I've tried many other methods on the skripting side of things, for example, I tried change the
to
Skript Author: SamDFL
Minecraft Version: 1.8.9
I've been trying to find a fix for this for ages, but I can't find it. Basically, I'm trying to teleport a player to a random location when they type /sw-join <arena>, which has been defined in a yaml file (see below for code). But it simply doesn't work for some reason, nothing happens. Any help would be much appreciated! Oh and also, I'm using WildSkript for yaml and not SkUtilites, I wont be switching, so please don't tell me to go to SkUtilites unless necessary.
---
Yaml Code:
code_language.skript:
arenas:
arena:
spawn:
'1': 'x: -697.39, y: 64, z: 807.93''
'2': 'x: -698.39, y: 64, z: 808.93'
Full Code:
code_language.skript:
variables:
{ingame} = false
options:
Prefix: &3[&bCometCraft&3]&f
Perm: skywars.staff
Config: plugins/SkyWars/skywars.yml
on skript load:
if file "{@Config}" doesn't exists:
create file "{@Config}"
set "" to "arenas" in yaml file "{@Config}"
command /skywars-create [<text>]:
aliases: /sw-create
usage: /skywars-create <arena name>
permission: {@Perm}
trigger:
if arg 1 isn't set:
message "{@Prefix} &cTo create an arena, select the arena with a worldedit wand and type &a&l/sw-create <map-name>&c!"
if arg 1 is set:
set "arenas" to "%arg 1%" in yaml file "{@Config}"
execute console command "/rg define %arg 1%"
execute console command "/rg flag %arg 1% passthrough allow"
execute console command "/rg flag %arg 1% mob-spawning deny"
execute console command "/rg flag %arg 1% pvp allow"
message "{@Prefix} &aSkywars match &c%arg 1% &acreated! Now, use &c/skywars-setspawn <arena> <spawn-number>&a to set the spawn islands of the map!"
stop trigger
command /skywars-setspawn <text> <int>:
aliases: /sw-setspawn
usage: /skywars-setspawn <arena name> <spawn number>
permission: {@Perm}
trigger:
set {_arena.%arg 1%} to single value "arenas.%arg 1%" get of "{@Config}"
set "arenas.%arg 1%.spawn.%arg 2%" to "%player's location%" in yaml file "{@Config}"
wait 1 tick
set {_spawn.%arg 1%.%arg 2%} to single value "arenas.%arg 1%.spawn.%arg 2%" get of "{@Config}"
wait 1 tick
message "{@Prefix} &aSkywars match &c%arg 1%&a's spawn number &c%arg 2% &ahas been set at &c%{_spawn.%arg 1%.%arg 2%}%!"
stop trigger
command /skywars-join <text>:
aliases: /sw-join
usage: /skywars-join <arena name>
permission: {@Perm}
trigger:
set {_spawns::*} to value list "arenas.%arg 1%.spawn" get of "{@Config}"
set {spawn-area} to random location out of {_spawns::*}
teleport player to {spawn-area}
stop trigger
Errors on Reload: None
Console Errors: None
Addons using (including versions):
Umbaska 2.0, WildSkript
Troubleshooting:
Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? I've tried many other methods on the skripting side of things, for example, I tried change the
code_language.skript:
set {spawn-area} to random location out of {_spawns::*}
code_language.skript:
set {spawn-area} to random text out of {_spawns::*}