aliases: /k1
trigger:
make player execute "kits:kit1"
set {_kit} to "kits:kit1"
broadcast "Player %player% has selected %{_kit}%."
command /kit2:
aliases: /k2
trigger:
make player execute "kits:kit2"
set {_kit} to "kits:kit2"
broadcast "Player %player% has selected %{_kit}%."
command /kit3:
aliases: /k3
trigger:
make player execute "kits:kit3"
set {_kit} to "kits:kit3"
broadcast "Player %player% has selected %{_kit}%."
on death of a player:
if {_kit} is set:
execute console command "/sudo %victim% %{_kit}%"
broadcast "The selected kit for %victim%: %{_kit}%"```
#Variable doesnt work?
1 messages · Page 1 of 1 (latest)
If a player dies it always says the variable {_kit} but not kits:kit3
and the /sudo is one that if a player dies that the player will be executed to type the command
The skript should just be like this, if a player executes /kit1 it will save as the variable {_kit} and if the player dies then the /kit1 will be executed for him and he will get the kit again
Youre using a local variable across events
And I would make it player-specific too