This worked fine for a while before, but recently I've been getting this error with those that have my trust. Switching the IDs also produce an error and I can't understand why I'm getting an error now, when it worked fine before.
function serverCmdTeleport(%client,%target)
{
if(%client.dirt >= 125)
{
if(%target !$= "")
{
%target = findClientByName(%target);
if(isObject(%target.player))
{
if(getTrustLevel(%target,%client) != 0)
{
%client.player.setTransform(%target.player.getPosition());
%client.dirt -= 125;
%client.play2D(buyItemSound);
%client.centerPrint("<font:Impact:24>\c6You have teleported to" SPC %target.name SPC "for 125 dirt.",2);
}
else
{
%client.centerPrint("<font:Impact:24>\c6" @ %target.name SPC "doesn't trust you enough to teleport to them.");
%client.play2D(MiningErrorSound);
return;
}
}
else
{
%client.centerPrint("<font:Impact:24>\c6This player doesn't exist!");
%client.play2D(MiningErrorSound);
return;
}
return;
}
It returns the "so and so doesn't trust you enough stuff", but it also returns a 0 along with the error when I echo the value of getTrustLevel().
Any way to fix it?
EDIT: It only works on a dedicated server...?