In a previous post I mentioned doing "spleef checks" (checking if one player spleef'd andother)
I tried to impliment this, but it doesnt work. Heres the code im using:
Script 1:
Script 2
All of the correct variables get set, everything is running, but the check is failing. I even check that the locations that are getting compared are the *exact same*, and they are
I have no idea why this is happening, any help is appreciated
I tried to impliment this, but it doesnt work. Heres the code im using:
Script 1:
Code:
on walking on snow block:
name of player's world is "combatspleef":
if {pvsGameStarted} is false:
stop
if {pvsGameStarted} is true:
set {lastWakedSnow.%event-player%} to "%x-coord of event-block%, %y-coord of event-block%, %z-coord of event-block%"
broadcast "%event-player% walked on %{lastWakedSnow.%event-player%}%"
on server tick start:
loop all players:
if name of loop-value's world is "combatspleef":
if loop-value is in water:
set {_victim} to loop-value
loop all players:
set {_attacker} to loop-value-1
contains({brokenBlocks.%{_attacker}%::*}, %{lastWalkedSnow.%{_victim}%}%) is true:
broadcast "%{_attacker}% spleef'd %{_victim}%"
on break:
name of event-player's world is "combatspleef":
{pvsGameStarted} is false:
player has permission "op":
stop
cancel event
{pvsGameStarted} is true:
add "%x-coord of event-block%, %y-coord of event-block%, %z-coord of event-block%" to {brokenBlocks.%event-player%::*}
broadcast "%event-player% broke %{brokenBlocks.%event-player%::*}%"
wait 10 seconds
remove "%x-coord of event-block%, %y-coord of event-block%, %z-coord of event-block%" from {brokenBlocks.%event-player%::*}
Script 2
Code:
function contains(list: objects, check: object) :: boolean:
loop {_list::*}:
if location at block of loop-value is location at block of {_check}:
broadcast "Check has passed"
return true
broadcast "Check has failed"
return false
All of the correct variables get set, everything is running, but the check is failing. I even check that the locations that are getting compared are the *exact same*, and they are
I have no idea why this is happening, any help is appreciated
Last edited: