What's wrong with getting the UUID in this function?
#3
I've got now:

	local addusertofile = function(OtherPlayer)
		if OtherPlayer:GetName() == Split[3] then
			friendusername = OtherPlayer:GetUUID()
			local file = io.open(friendDir.."\\friends.txt", "a")
			file:write(friendusername.."\n")
			file:close()
			Player:SendMessageSuccess("Friend added. You can check with /friend [playername]")
		else
			Player:SendMessageFailure("Fail")
		end
	end
	if not cRoot:Get():FindAndDoWithPlayer(Split[3], addusertofile) then
		local UUID = cMojangAPI:GetUUIDFromPlayerName(Split[3], true)
		if (UUID == "" or UUID == nil) then
			Player:SendMessageFailure("Invalid Playername")
		return true
		end
		local file = io.open(friendDir .. "/friends.txt", "a")
		file:write(UUID, "\n")
		file:close()
		Player:SendMessageSuccess("Friend added. You can check with /friend [playername]")
	end

Still invalid player.
Reply
Thanks given by:


Messages In This Thread
RE: What's wrong with getting the UUID in this function? - by Gamerboy59 - 11-19-2015, 01:30 AM



Users browsing this thread: 1 Guest(s)